@@ -29,7 +29,7 @@ describe('Example Airdrop zkApp', () => {
29
29
30
30
beforeEach ( ( ) => Mina . LocalBlockchain ( { proofsEnabled : true } )
31
31
. then ( ( local ) => {
32
- tree = new MerkleTree ( 17 ) ;
32
+ tree = new MerkleTree ( 33 ) ;
33
33
Mina . setActiveInstance ( local ) ;
34
34
app = new Airdrop ( appAddr ) ;
35
35
local . addAccount ( deployer , "100000000000" ) ;
@@ -39,12 +39,11 @@ describe('Example Airdrop zkApp', () => {
39
39
const fundZkApp = ( ) => Mina . transaction ( sender , async ( ) => {
40
40
let senderUpdate = AccountUpdate . create ( sender ) ;
41
41
senderUpdate . requireSignature ( ) ;
42
- senderUpdate . send ( { to : appAddr , amount : UInt64 . from ( 100 * 1e9 ) } ) ;
42
+ senderUpdate . send ( { to : appAddr , amount : 100 * 1e9 } ) ;
43
43
} ) . then ( ( txn ) => txn . prove ( ) )
44
44
. then ( ( txn ) => txn . sign ( [ senderKey ] ) . send ( ) ) ;
45
45
46
-
47
- const deploy = ( ) => Mina . transaction ( deployer , async ( ) => {
46
+ const deploy = ( ) => Mina . transaction ( deployer , ( ) => {
48
47
AccountUpdate . fundNewAccount ( deployer ) ;
49
48
return app . deploy ( )
50
49
} ) . then ( ( txn ) => txn . prove ( ) )
@@ -70,8 +69,8 @@ describe('Example Airdrop zkApp', () => {
70
69
await deploy ( ) ;
71
70
await fundZkApp ( ) ;
72
71
73
- const id1 = 123123123123123n ;
74
- const truncatedId1 = id1 % 65536n ;
72
+ const id1 = 123123123123123123123123123123n ;
73
+ const truncatedId1 = id1 % ( 1n << 32n ) ;
75
74
await Mina . transaction (
76
75
sender ,
77
76
( ) => app . claimReward ( Field ( id1 ) , sigs , new HumanIDWitness ( tree . getWitness ( truncatedId1 ) ) )
@@ -81,8 +80,8 @@ describe('Example Airdrop zkApp', () => {
81
80
82
81
tree . setLeaf ( truncatedId1 , Field ( 1 ) ) ;
83
82
84
- const id2 = 123123123123124n ;
85
- const truncatedId2 = id2 % 65536n ;
83
+ const id2 = 123123123123123123123123123124n ;
84
+ const truncatedId2 = id2 % ( 1n << 32n ) ;
86
85
await Mina . transaction (
87
86
sender ,
88
87
( ) => app . claimReward ( Field ( id2 ) , sigs , new HumanIDWitness ( tree . getWitness ( truncatedId2 ) ) )
@@ -136,7 +135,7 @@ describe('Example Airdrop zkApp', () => {
136
135
)
137
136
. then ( ( txn ) => txn . prove ( ) )
138
137
. then ( ( txn ) => txn . sign ( [ senderKey ] ) . send ( ) ) ;
139
-
138
+
140
139
let secondBalance = Mina . getBalance ( sender ) ;
141
140
142
141
expect ( secondBalance . sub ( firstBalance ) ) . toEqual ( UInt64 . from ( 10 * 1e9 ) ) ;
0 commit comments