File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -191,9 +191,9 @@ impl<T: Transport> Eth<T> {
191
191
}
192
192
193
193
/// Get code under given address
194
- pub fn code ( & self , address : Address , block : Option < BlockNumber > ) -> CallFuture < Bytes , T :: Out > {
194
+ pub fn code ( & self , address : Address , block : Option < BlockId > ) -> CallFuture < Bytes , T :: Out > {
195
195
let address = helpers:: serialize ( & address) ;
196
- let block = helpers:: serialize ( & block. unwrap_or ( BlockNumber :: Latest ) ) ;
196
+ let block = helpers:: serialize ( & block. unwrap_or_else ( || BlockNumber :: Latest . into ( ) ) ) ;
197
197
198
198
CallFuture :: new ( self . transport . execute ( "eth_getCode" , vec ! [ address, block] ) )
199
199
}
@@ -736,7 +736,7 @@ mod tests {
736
736
) ;
737
737
738
738
rpc_test ! (
739
- Eth : code, H256 :: from_low_u64_be( 0x123 ) , Some ( BlockNumber :: Pending )
739
+ Eth : code, H256 :: from_low_u64_be( 0x123 ) , Some ( BlockId :: Number ( BlockNumber :: Pending ) )
740
740
=>
741
741
"eth_getCode" , vec![ r#""0x0000000000000000000000000000000000000123""# , r#""pending""# ] ;
742
742
Value :: String ( "0x0123" . into( ) ) => hex!( "0123" )
You can’t perform that action at this time.
0 commit comments