@@ -25,9 +25,8 @@ describe('deploy and test Wallet', () => {
2525 contract : compiledErc20 ,
2626 } ) ;
2727
28- erc20Address = erc20Response . address ! ;
28+ erc20Address = erc20Response . contract_address ! ;
2929 erc20 = new Contract ( compiledErc20 . abi , erc20Address , provider ) ;
30- expect ( erc20Response . code ) . toBe ( 'TRANSACTION_RECEIVED' ) ;
3130
3231 await provider . waitForTransaction ( erc20Response . transaction_hash ) ;
3332
@@ -37,8 +36,6 @@ describe('deploy and test Wallet', () => {
3736 calldata : [ account . address , '1000' ] ,
3837 } ) ;
3938
40- expect ( mintResponse . code ) . toBe ( 'TRANSACTION_RECEIVED' ) ;
41-
4239 await provider . waitForTransaction ( mintResponse . transaction_hash ) ;
4340
4441 const x = await erc20 . balance_of ( account . address ) ;
@@ -48,20 +45,18 @@ describe('deploy and test Wallet', () => {
4845 const dappResponse = await provider . deployContract ( {
4946 contract : compiledTestDapp ,
5047 } ) ;
51- dapp = new Contract ( compiledTestDapp . abi , dappResponse . address ! , provider ) ;
52- expect ( dappResponse . code ) . toBe ( 'TRANSACTION_RECEIVED' ) ;
48+ dapp = new Contract ( compiledTestDapp . abi , dappResponse . contract_address ! , provider ) ;
5349
5450 await provider . waitForTransaction ( dappResponse . transaction_hash ) ;
5551 } ) ;
5652
5753 test ( 'estimate fee' , async ( ) => {
58- const { amount , unit } = await account . estimateFee ( {
54+ const { overall_fee } = await account . estimateFee ( {
5955 contractAddress : erc20Address ,
6056 entrypoint : 'transfer' ,
6157 calldata : [ erc20 . address , '10' ] ,
6258 } ) ;
63- expect ( isBN ( amount ) ) . toBe ( true ) ;
64- expect ( typeof unit ) . toBe ( 'string' ) ;
59+ expect ( isBN ( overall_fee ) ) . toBe ( true ) ;
6560 } ) ;
6661
6762 test ( 'read balance of wallet' , async ( ) => {
@@ -71,13 +66,12 @@ describe('deploy and test Wallet', () => {
7166 } ) ;
7267
7368 test ( 'execute by wallet owner' , async ( ) => {
74- const { code , transaction_hash } = await account . execute ( {
69+ const { transaction_hash } = await account . execute ( {
7570 contractAddress : erc20Address ,
7671 entrypoint : 'transfer' ,
7772 calldata : [ erc20 . address , '10' ] ,
7873 } ) ;
7974
80- expect ( code ) . toBe ( 'TRANSACTION_RECEIVED' ) ;
8175 await provider . waitForTransaction ( transaction_hash ) ;
8276 } ) ;
8377
@@ -93,7 +87,7 @@ describe('deploy and test Wallet', () => {
9387 entrypoint : 'get_nonce' ,
9488 } ) ;
9589 const nonce = toBN ( result [ 0 ] ) . toNumber ( ) ;
96- const { code , transaction_hash } = await account . execute (
90+ const { transaction_hash } = await account . execute (
9791 {
9892 contractAddress : erc20Address ,
9993 entrypoint : 'transfer' ,
@@ -103,12 +97,11 @@ describe('deploy and test Wallet', () => {
10397 { nonce }
10498 ) ;
10599
106- expect ( code ) . toBe ( 'TRANSACTION_RECEIVED' ) ;
107100 await provider . waitForTransaction ( transaction_hash ) ;
108101 } ) ;
109102
110103 test ( 'execute multiple transactions' , async ( ) => {
111- const { code , transaction_hash } = await account . execute ( [
104+ const { transaction_hash } = await account . execute ( [
112105 {
113106 contractAddress : dapp . address ,
114107 entrypoint : 'set_number' ,
@@ -121,7 +114,6 @@ describe('deploy and test Wallet', () => {
121114 } ,
122115 ] ) ;
123116
124- expect ( code ) . toBe ( 'TRANSACTION_RECEIVED' ) ;
125117 await provider . waitForTransaction ( transaction_hash ) ;
126118
127119 const response = await dapp . get_number ( account . address ) ;
@@ -154,7 +146,7 @@ describe('deploy and test Wallet', () => {
154146
155147 await provider . waitForTransaction ( accountResponse . transaction_hash ) ;
156148
157- newAccount = new Account ( provider , accountResponse . address ! , starkKeyPair ) ;
149+ newAccount = new Account ( provider , accountResponse . contract_address ! , starkKeyPair ) ;
158150 } ) ;
159151
160152 test ( 'read nonce' , async ( ) => {
@@ -178,8 +170,6 @@ describe('deploy and test Wallet', () => {
178170 calldata : [ wallet , '1000' ] ,
179171 } ) ;
180172
181- expect ( mintResponse . code ) . toBe ( 'TRANSACTION_RECEIVED' ) ;
182-
183173 await provider . waitForTransaction ( mintResponse . transaction_hash ) ;
184174 } ) ;
185175
@@ -191,8 +181,7 @@ describe('deploy and test Wallet', () => {
191181
192182 test ( 'estimate gas fee for `mint`' , async ( ) => {
193183 const res = await erc20 . estimateFee . mint ( wallet , '10' ) ;
194- expect ( res ) . toHaveProperty ( 'amount' ) ;
195- expect ( res ) . toHaveProperty ( 'unit' ) ;
184+ expect ( res ) . toHaveProperty ( 'overall_fee' ) ;
196185 } ) ;
197186 } ) ;
198187} ) ;
0 commit comments