File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 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) -> ! {
604604 native:: ethereum_selfDestruct ( address. bytes . as_ptr ( ) as * const u32 ) ;
605605 }
606606}
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" {
7474 pub fn ethereum_storageLoad ( keyOffset : * const u32 , resultOffset : * const u32 ) ;
7575 pub fn ethereum_storageStore ( keyOffset : * const u32 , valueOffset : * const u32 ) ;
7676 pub fn ethereum_selfDestruct ( addressOffset : * const u32 ) -> !;
77+ pub fn ethereum_isAccountEmpty ( addressOffset : * const u32 ) -> u32 ;
7778}
You can’t perform that action at this time.
0 commit comments