File tree 2 files changed +10
-0
lines changed
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -604,3 +604,12 @@ pub fn selfdestruct(address: &Address) -> ! {
604
604
native:: ethereum_selfDestruct ( address. bytes . as_ptr ( ) as * const u32 ) ;
605
605
}
606
606
}
607
+
608
+ pub fn is_account_empty ( address : & Address ) -> bool {
609
+ let ret = unsafe { native:: ethereum_isAccountEmpty ( address. bytes . as_ptr ( ) as * const u32 ) } ;
610
+ if ret != 0 && ret != 1 {
611
+ panic ! ( ) ;
612
+ }
613
+
614
+ ret == 1
615
+ }
Original file line number Diff line number Diff line change @@ -74,4 +74,5 @@ extern "C" {
74
74
pub fn ethereum_storageLoad ( keyOffset : * const u32 , resultOffset : * const u32 ) ;
75
75
pub fn ethereum_storageStore ( keyOffset : * const u32 , valueOffset : * const u32 ) ;
76
76
pub fn ethereum_selfDestruct ( addressOffset : * const u32 ) -> !;
77
+ pub fn ethereum_isAccountEmpty ( addressOffset : * const u32 ) -> u32 ;
77
78
}
You can’t perform that action at this time.
0 commit comments