diff --git a/src/tests/chain_context_tests.rs b/src/tests/chain_context_tests.rs index a7254e3..b9a5d10 100644 --- a/src/tests/chain_context_tests.rs +++ b/src/tests/chain_context_tests.rs @@ -260,8 +260,8 @@ mod tests { runtime .call(&solidity_selector("test_prevrandao()"), &[]) .unwrap(); - // DEFAULT_PREVRANDAO: 0000000000000000000000000505050505050505050505050505050505050505 - runtime.assert_result("0000000000000000000000000505050505050505050505050505050505050505"); + // DEFAULT_PREVRANDAO: 0505050505050505050505050505050505050505050505050505050505050505 + runtime.assert_result("0505050505050505050505050505050505050505050505050505050505050505"); } #[test] @@ -292,8 +292,8 @@ mod tests { runtime .call(&solidity_selector("test_difficulty()"), &[]) .unwrap(); - // DEFAULT_PREVRANDAO: 0000000000000000000000000505050505050505050505050505050505050505 - runtime.assert_result("0000000000000000000000000505050505050505050505050505050505050505"); + // DEFAULT_PREVRANDAO: 0505050505050505050505050505050505050505050505050505050505050505 + runtime.assert_result("0505050505050505050505050505050505050505050505050505050505050505"); } #[test] diff --git a/stdlib/chain.c b/stdlib/chain.c index 327c232..e80727e 100644 --- a/stdlib/chain.c +++ b/stdlib/chain.c @@ -191,8 +191,7 @@ void wrapper_block_coin_base(bytes32 *result) { } void wrapper_block_prevRandao(bytes32 *result) { - getBlockPrevRandao(12 + (ADDRESS_UINT)result); // 32 bytes - clear_first_12_bytes(result); + getBlockPrevRandao((ADDRESS_UINT)result); // 32 bytes } void wrapper_callvalue(uint256_t *result) {