File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -14,3 +14,4 @@ wee_alloc = "0.4.4"
1414default = [ " std" ]
1515std = []
1616debug = []
17+ experimental = []
Original file line number Diff line number Diff line change 1+ //! Experimental methods.
2+
3+ use super :: * ;
4+
5+ pub mod native {
6+ extern "C" {
7+ pub fn experimental_isAccountEmpty ( addressOffset : * const u32 ) -> u32 ;
8+ }
9+ }
10+
11+ pub fn is_account_empty ( address : & Address ) -> bool {
12+ let ret = unsafe { native:: experimental_isAccountEmpty ( address. bytes . as_ptr ( ) as * const u32 ) } ;
13+ if ret != 0 && ret != 1 {
14+ panic ! ( ) ;
15+ }
16+
17+ ret == 1
18+ }
Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ pub mod debug;
3232#[ cfg( not( feature = "std" ) ) ]
3333pub mod convert;
3434
35+ #[ cfg( feature = "experimental" ) ]
36+ pub mod experimental;
37+
3538#[ cfg( feature = "std" ) ]
3639use std:: vec:: Vec ;
3740
You can’t perform that action at this time.
0 commit comments