File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 11const rpcBaseUrl = 'http://localhost:8080' ;
22const contractAddr = '0000000000000000000000000000000000000001' ;
33const fromPubKey = '03db73ea4b9eb3f0f9d46034f194ba098229841133467a209070207b75a202db8b' ;
4- const amount = 1000 ;
4+ const depositAmount = 1000 ;
55
66const axios = require ( 'axios' ) ;
77
@@ -13,14 +13,15 @@ const transaction = {
1313 createdAt : Math . floor ( Date . now ( ) / 1000 ) ,
1414 nonce : 0 ,
1515 gasPrice : 1 ,
16- amount : amount ,
16+ amount : 0 ,
1717 to : contractAddr
1818} ;
1919
2020transaction . payload = Buffer . concat (
2121 [
2222 Buffer . from ( [ 'deposit' . length ] ) ,
23- Buffer . from ( 'deposit' , 'ascii' )
23+ Buffer . from ( 'deposit' , 'ascii' ) ,
24+ Buffer . from ( `{"depositAmount": ${ depositAmount } }` , 'ascii' )
2425 ]
2526) ;
2627
Original file line number Diff line number Diff line change 11const rpcBaseUrl = 'http://localhost:8080' ;
22const contractAddr = '0000000000000000000000000000000000000001' ;
33const fromPubKey = '03db73ea4b9eb3f0f9d46034f194ba098229841133467a209070207b75a202db8b' ;
4- const amount = 987 ;
4+ const withdrawAmount = 987 ;
55
66const axios = require ( 'axios' ) ;
77
@@ -13,14 +13,15 @@ const transaction = {
1313 createdAt : Math . floor ( Date . now ( ) / 1000 ) ,
1414 nonce : 0 ,
1515 gasPrice : 1 ,
16- amount : amount ,
16+ amount : 0 ,
1717 to : contractAddr
1818} ;
1919
2020transaction . payload = Buffer . concat (
2121 [
2222 Buffer . from ( [ 'withdraw' . length ] ) ,
23- Buffer . from ( 'withdraw' , 'ascii' )
23+ Buffer . from ( 'withdraw' , 'ascii' ) ,
24+ Buffer . from ( `{"withdrawAmount": ${ withdrawAmount } }` , 'ascii' )
2425 ]
2526) ;
2627
You can’t perform that action at this time.
0 commit comments