File tree 1 file changed +4
-2
lines changed
bus-mapping/src/evm/opcodes
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ use crate::{
4
4
operation:: CallContextField ,
5
5
Error ,
6
6
} ;
7
- use eth_types:: GethExecStep ;
7
+ use eth_types:: { GethExecStep , ToWord } ;
8
8
9
9
#[ derive( Debug , Copy , Clone ) ]
10
10
pub ( crate ) struct Origin ;
@@ -17,7 +17,7 @@ impl Opcode for Origin {
17
17
let geth_step = & geth_steps[ 0 ] ;
18
18
let mut exec_step = state. new_step ( geth_step) ?;
19
19
// TODO: Get origin result
20
- let value = geth_steps [ 1 ] . stack . last ( ) ? ;
20
+ let value = state . tx . from . to_word ( ) ;
21
21
let tx_id = state. tx_ctx . id ( ) ;
22
22
23
23
// CallContext read of the TxId
@@ -29,6 +29,8 @@ impl Opcode for Origin {
29
29
) ?;
30
30
31
31
// Stack write of the origin address value
32
+ #[ cfg( feature = "stack-check" ) ]
33
+ assert_eq ! ( value, geth_steps[ 1 ] . stack. last( ) ?) ;
32
34
state. stack_push ( & mut exec_step, value) ?;
33
35
34
36
Ok ( vec ! [ exec_step] )
You can’t perform that action at this time.
0 commit comments