Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 60b8ba9

Browse files
authoredJun 27, 2023
Add tests for using ints in contracts, and test case for web3-eth-abi's encodeFunctionCall (#6221)
* Init contract NegativeNumbers tests * Add encodeFunctionCall test cases from #5890 * Init NegativeNumbers.sol * Refactor test to work with cypress * Fix tests to work with cypress * Fix tests
1 parent 3f49e18 commit 60b8ba9

File tree

5 files changed

+609
-0
lines changed

5 files changed

+609
-0
lines changed
 

‎fixtures/build/NegativeNumbers.json

+201
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
{
2+
"abi": [
3+
{
4+
"inputs": [
5+
{
6+
"internalType": "int256",
7+
"name": "number",
8+
"type": "int256"
9+
}
10+
],
11+
"stateMutability": "nonpayable",
12+
"type": "constructor"
13+
},
14+
{
15+
"anonymous": false,
16+
"inputs": [
17+
{
18+
"indexed": false,
19+
"internalType": "int256",
20+
"name": "one",
21+
"type": "int256"
22+
}
23+
],
24+
"name": "OneNegativeNumber",
25+
"type": "event"
26+
},
27+
{
28+
"anonymous": false,
29+
"inputs": [
30+
{
31+
"indexed": true,
32+
"internalType": "int256",
33+
"name": "one",
34+
"type": "int256"
35+
}
36+
],
37+
"name": "OneNegativeNumberIndexed",
38+
"type": "event"
39+
},
40+
{
41+
"anonymous": false,
42+
"inputs": [
43+
{
44+
"indexed": false,
45+
"internalType": "uint256",
46+
"name": "positive",
47+
"type": "uint256"
48+
},
49+
{
50+
"indexed": false,
51+
"internalType": "int256",
52+
"name": "negative",
53+
"type": "int256"
54+
},
55+
{
56+
"indexed": false,
57+
"internalType": "string",
58+
"name": "str",
59+
"type": "string"
60+
}
61+
],
62+
"name": "OtherNegativeNumbers",
63+
"type": "event"
64+
},
65+
{
66+
"anonymous": false,
67+
"inputs": [
68+
{
69+
"indexed": true,
70+
"internalType": "uint256",
71+
"name": "positive",
72+
"type": "uint256"
73+
},
74+
{
75+
"indexed": true,
76+
"internalType": "int256",
77+
"name": "negative",
78+
"type": "int256"
79+
},
80+
{
81+
"indexed": false,
82+
"internalType": "string",
83+
"name": "str",
84+
"type": "string"
85+
}
86+
],
87+
"name": "OtherNegativeNumbersIndexed",
88+
"type": "event"
89+
},
90+
{
91+
"anonymous": false,
92+
"inputs": [
93+
{
94+
"indexed": false,
95+
"internalType": "int256",
96+
"name": "one",
97+
"type": "int256"
98+
},
99+
{
100+
"indexed": false,
101+
"internalType": "int256",
102+
"name": "two",
103+
"type": "int256"
104+
}
105+
],
106+
"name": "TwoNegativeNumbers",
107+
"type": "event"
108+
},
109+
{
110+
"anonymous": false,
111+
"inputs": [
112+
{
113+
"indexed": true,
114+
"internalType": "int256",
115+
"name": "one",
116+
"type": "int256"
117+
},
118+
{
119+
"indexed": true,
120+
"internalType": "int256",
121+
"name": "two",
122+
"type": "int256"
123+
}
124+
],
125+
"name": "TwoNegativeNumbersIndexed",
126+
"type": "event"
127+
},
128+
{
129+
"inputs": [
130+
{
131+
"internalType": "int256",
132+
"name": "number",
133+
"type": "int256"
134+
}
135+
],
136+
"name": "oneNegativeNumber",
137+
"outputs": [],
138+
"stateMutability": "nonpayable",
139+
"type": "function"
140+
},
141+
{
142+
"inputs": [
143+
{
144+
"internalType": "int256",
145+
"name": "number",
146+
"type": "int256"
147+
},
148+
{
149+
"internalType": "int256",
150+
"name": "number2",
151+
"type": "int256"
152+
},
153+
{
154+
"internalType": "string",
155+
"name": "str",
156+
"type": "string"
157+
}
158+
],
159+
"name": "otherNegativeNumbers",
160+
"outputs": [],
161+
"stateMutability": "nonpayable",
162+
"type": "function"
163+
},
164+
{
165+
"inputs": [],
166+
"name": "storedNegativeNumber",
167+
"outputs": [
168+
{
169+
"internalType": "int256",
170+
"name": "",
171+
"type": "int256"
172+
}
173+
],
174+
"stateMutability": "view",
175+
"type": "function"
176+
},
177+
{
178+
"inputs": [
179+
{
180+
"internalType": "int256",
181+
"name": "number",
182+
"type": "int256"
183+
},
184+
{
185+
"internalType": "int256",
186+
"name": "number2",
187+
"type": "int256"
188+
}
189+
],
190+
"name": "twoNegativeNumbers",
191+
"outputs": [],
192+
"stateMutability": "nonpayable",
193+
"type": "function"
194+
}
195+
],
196+
"evm": {
197+
"bytecode": {
198+
"object": "608060405234801561001057600080fd5b506040516105b93803806105b98339818101604052810190610032919061007a565b80600081905550506100a7565b600080fd5b6000819050919050565b61005781610044565b811461006257600080fd5b50565b6000815190506100748161004e565b92915050565b6000602082840312156100905761008f61003f565b5b600061009e84828501610065565b91505092915050565b610503806100b66000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806309872ebc1461005157806310e9b2b41461006f5780634a299b871461008b5780636119780b146100a7575b600080fd5b6100596100c3565b6040516100669190610232565b60405180910390f35b61008960048036038101906100849190610283565b6100c9565b005b6100a560048036038101906100a09190610315565b610130565b005b6100c160048036038101906100bc9190610389565b6101ae565b005b60005481565b7f5b53dc4e9e8fa2416d4e172bdad04be5a6d622643bc9ef45987b2caadd0d0c95816040516100f89190610232565b60405180910390a1807f33e7dccd3899498f4408d6468e5dfad650f32574dba2ec4f13399a82e62166d560405160405180910390a250565b7f2e1fb99ee1b27b6491b2d46a54ac8daca82f2da6810e4b8eed4d634f78fa6948848484846040516101659493929190610440565b60405180910390a182847f0e29b573959c1b6ffd5e16886385ec1732e187cc5ac10e8faceb5e02a1c7b50b84846040516101a0929190610480565b60405180910390a350505050565b7ffaa997e4b16dcde196bbb99868e16fa934a0b4c1f019e494d9fbffb5abc46fc282826040516101df9291906104a4565b60405180910390a180827f0204c97becd72594486cf753e30e8acfc9951ee663e404bc858e3d10b80da99b60405160405180910390a35050565b6000819050919050565b61022c81610219565b82525050565b60006020820190506102476000830184610223565b92915050565b600080fd5b600080fd5b61026081610219565b811461026b57600080fd5b50565b60008135905061027d81610257565b92915050565b6000602082840312156102995761029861024d565b5b60006102a78482850161026e565b91505092915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126102d5576102d46102b0565b5b8235905067ffffffffffffffff8111156102f2576102f16102b5565b5b60208301915083600182028301111561030e5761030d6102ba565b5b9250929050565b6000806000806060858703121561032f5761032e61024d565b5b600061033d8782880161026e565b945050602061034e8782880161026e565b935050604085013567ffffffffffffffff81111561036f5761036e610252565b5b61037b878288016102bf565b925092505092959194509250565b600080604083850312156103a05761039f61024d565b5b60006103ae8582860161026e565b92505060206103bf8582860161026e565b9150509250929050565b6000819050919050565b6103dc816103c9565b82525050565b600082825260208201905092915050565b82818337600083830152505050565b6000601f19601f8301169050919050565b600061041f83856103e2565b935061042c8385846103f3565b61043583610402565b840190509392505050565b600060608201905061045560008301876103d3565b6104626020830186610223565b8181036040830152610475818486610413565b905095945050505050565b6000602082019050818103600083015261049b818486610413565b90509392505050565b60006040820190506104b96000830185610223565b6104c66020830184610223565b939250505056fea26469706673582212203eb052901c785465d43fe463b8123363abc0767d1df3b47a9c4cdc319870d8c264736f6c634300080d0033"
199+
}
200+
}
201+
}

‎fixtures/build/NegativeNumbers.ts

+213
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
/*
2+
This file is part of web3.js.
3+
4+
web3.js is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU Lesser General Public License as published by
6+
the Free Software Foundation, either version 3 of the License, or
7+
(at your option) any later version.
8+
9+
web3.js is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public License
15+
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
export const NegativeNumbersAbi = [
18+
{
19+
inputs: [
20+
{
21+
internalType: 'int256',
22+
name: 'number',
23+
type: 'int256',
24+
},
25+
],
26+
stateMutability: 'nonpayable',
27+
type: 'constructor',
28+
},
29+
{
30+
anonymous: false,
31+
inputs: [
32+
{
33+
indexed: false,
34+
internalType: 'int256',
35+
name: 'one',
36+
type: 'int256',
37+
},
38+
],
39+
name: 'OneNegativeNumber',
40+
type: 'event',
41+
},
42+
{
43+
anonymous: false,
44+
inputs: [
45+
{
46+
indexed: true,
47+
internalType: 'int256',
48+
name: 'one',
49+
type: 'int256',
50+
},
51+
],
52+
name: 'OneNegativeNumberIndexed',
53+
type: 'event',
54+
},
55+
{
56+
anonymous: false,
57+
inputs: [
58+
{
59+
indexed: false,
60+
internalType: 'uint256',
61+
name: 'positive',
62+
type: 'uint256',
63+
},
64+
{
65+
indexed: false,
66+
internalType: 'int256',
67+
name: 'negative',
68+
type: 'int256',
69+
},
70+
{
71+
indexed: false,
72+
internalType: 'string',
73+
name: 'str',
74+
type: 'string',
75+
},
76+
],
77+
name: 'OtherNegativeNumbers',
78+
type: 'event',
79+
},
80+
{
81+
anonymous: false,
82+
inputs: [
83+
{
84+
indexed: true,
85+
internalType: 'uint256',
86+
name: 'positive',
87+
type: 'uint256',
88+
},
89+
{
90+
indexed: true,
91+
internalType: 'int256',
92+
name: 'negative',
93+
type: 'int256',
94+
},
95+
{
96+
indexed: false,
97+
internalType: 'string',
98+
name: 'str',
99+
type: 'string',
100+
},
101+
],
102+
name: 'OtherNegativeNumbersIndexed',
103+
type: 'event',
104+
},
105+
{
106+
anonymous: false,
107+
inputs: [
108+
{
109+
indexed: false,
110+
internalType: 'int256',
111+
name: 'one',
112+
type: 'int256',
113+
},
114+
{
115+
indexed: false,
116+
internalType: 'int256',
117+
name: 'two',
118+
type: 'int256',
119+
},
120+
],
121+
name: 'TwoNegativeNumbers',
122+
type: 'event',
123+
},
124+
{
125+
anonymous: false,
126+
inputs: [
127+
{
128+
indexed: true,
129+
internalType: 'int256',
130+
name: 'one',
131+
type: 'int256',
132+
},
133+
{
134+
indexed: true,
135+
internalType: 'int256',
136+
name: 'two',
137+
type: 'int256',
138+
},
139+
],
140+
name: 'TwoNegativeNumbersIndexed',
141+
type: 'event',
142+
},
143+
{
144+
inputs: [
145+
{
146+
internalType: 'int256',
147+
name: 'number',
148+
type: 'int256',
149+
},
150+
],
151+
name: 'oneNegativeNumber',
152+
outputs: [],
153+
stateMutability: 'nonpayable',
154+
type: 'function',
155+
},
156+
{
157+
inputs: [
158+
{
159+
internalType: 'int256',
160+
name: 'number',
161+
type: 'int256',
162+
},
163+
{
164+
internalType: 'int256',
165+
name: 'number2',
166+
type: 'int256',
167+
},
168+
{
169+
internalType: 'string',
170+
name: 'str',
171+
type: 'string',
172+
},
173+
],
174+
name: 'otherNegativeNumbers',
175+
outputs: [],
176+
stateMutability: 'nonpayable',
177+
type: 'function',
178+
},
179+
{
180+
inputs: [],
181+
name: 'storedNegativeNumber',
182+
outputs: [
183+
{
184+
internalType: 'int256',
185+
name: '',
186+
type: 'int256',
187+
},
188+
],
189+
stateMutability: 'view',
190+
type: 'function',
191+
},
192+
{
193+
inputs: [
194+
{
195+
internalType: 'int256',
196+
name: 'number',
197+
type: 'int256',
198+
},
199+
{
200+
internalType: 'int256',
201+
name: 'number2',
202+
type: 'int256',
203+
},
204+
],
205+
name: 'twoNegativeNumbers',
206+
outputs: [],
207+
stateMutability: 'nonpayable',
208+
type: 'function',
209+
},
210+
] as const;
211+
212+
export const NegativeNumbersBytecode =
213+
'0x608060405234801561001057600080fd5b506040516105b93803806105b98339818101604052810190610032919061007a565b80600081905550506100a7565b600080fd5b6000819050919050565b61005781610044565b811461006257600080fd5b50565b6000815190506100748161004e565b92915050565b6000602082840312156100905761008f61003f565b5b600061009e84828501610065565b91505092915050565b610503806100b66000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806309872ebc1461005157806310e9b2b41461006f5780634a299b871461008b5780636119780b146100a7575b600080fd5b6100596100c3565b6040516100669190610232565b60405180910390f35b61008960048036038101906100849190610283565b6100c9565b005b6100a560048036038101906100a09190610315565b610130565b005b6100c160048036038101906100bc9190610389565b6101ae565b005b60005481565b7f5b53dc4e9e8fa2416d4e172bdad04be5a6d622643bc9ef45987b2caadd0d0c95816040516100f89190610232565b60405180910390a1807f33e7dccd3899498f4408d6468e5dfad650f32574dba2ec4f13399a82e62166d560405160405180910390a250565b7f2e1fb99ee1b27b6491b2d46a54ac8daca82f2da6810e4b8eed4d634f78fa6948848484846040516101659493929190610440565b60405180910390a182847f0e29b573959c1b6ffd5e16886385ec1732e187cc5ac10e8faceb5e02a1c7b50b84846040516101a0929190610480565b60405180910390a350505050565b7ffaa997e4b16dcde196bbb99868e16fa934a0b4c1f019e494d9fbffb5abc46fc282826040516101df9291906104a4565b60405180910390a180827f0204c97becd72594486cf753e30e8acfc9951ee663e404bc858e3d10b80da99b60405160405180910390a35050565b6000819050919050565b61022c81610219565b82525050565b60006020820190506102476000830184610223565b92915050565b600080fd5b600080fd5b61026081610219565b811461026b57600080fd5b50565b60008135905061027d81610257565b92915050565b6000602082840312156102995761029861024d565b5b60006102a78482850161026e565b91505092915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126102d5576102d46102b0565b5b8235905067ffffffffffffffff8111156102f2576102f16102b5565b5b60208301915083600182028301111561030e5761030d6102ba565b5b9250929050565b6000806000806060858703121561032f5761032e61024d565b5b600061033d8782880161026e565b945050602061034e8782880161026e565b935050604085013567ffffffffffffffff81111561036f5761036e610252565b5b61037b878288016102bf565b925092505092959194509250565b600080604083850312156103a05761039f61024d565b5b60006103ae8582860161026e565b92505060206103bf8582860161026e565b9150509250929050565b6000819050919050565b6103dc816103c9565b82525050565b600082825260208201905092915050565b82818337600083830152505050565b6000601f19601f8301169050919050565b600061041f83856103e2565b935061042c8385846103f3565b61043583610402565b840190509392505050565b600060608201905061045560008301876103d3565b6104626020830186610223565b8181036040830152610475818486610413565b905095945050505050565b6000602082019050818103600083015261049b818486610413565b90509392505050565b60006040820190506104b96000830185610223565b6104c66020830184610223565b939250505056fea26469706673582212203eb052901c785465d43fe463b8123363abc0767d1df3b47a9c4cdc319870d8c264736f6c634300080d0033';
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity 0.8.13;
3+
4+
contract NegativeNumbers {
5+
int256 public storedNegativeNumber;
6+
7+
event OneNegativeNumber(int256 one);
8+
event OneNegativeNumberIndexed(int256 indexed one);
9+
event TwoNegativeNumbers(int256 one, int256 two);
10+
event TwoNegativeNumbersIndexed(int256 indexed one, int256 indexed two);
11+
event OtherNegativeNumbers(uint256 positive, int256 negative, string str);
12+
event OtherNegativeNumbersIndexed(
13+
uint256 indexed positive,
14+
int256 indexed negative,
15+
string str
16+
);
17+
18+
constructor(int256 number) {
19+
storedNegativeNumber = number;
20+
}
21+
22+
function oneNegativeNumber(int256 number) public {
23+
emit OneNegativeNumber(number);
24+
emit OneNegativeNumberIndexed(number);
25+
}
26+
27+
function twoNegativeNumbers(int256 number, int256 number2) public {
28+
emit TwoNegativeNumbers(number, number2);
29+
emit TwoNegativeNumbersIndexed(number, number2);
30+
}
31+
32+
function otherNegativeNumbers(
33+
int256 number,
34+
int256 number2,
35+
string calldata str
36+
) public {
37+
emit OtherNegativeNumbers(uint256(number), number2, str);
38+
emit OtherNegativeNumbersIndexed(uint256(number), number2, str);
39+
}
40+
}

‎packages/web3-eth-abi/test/fixtures/data.ts

+33
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,39 @@ export const validFunctionsCall: { input: { abi: any; params: any }; output: str
243243
},
244244
output: '0x24ee0097000000000000000000000000000000000000000000000000000000008bd02b7b0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000748656c6c6f212500000000000000000000000000000000000000000000000000',
245245
},
246+
{
247+
input: {
248+
abi: {
249+
type: 'function',
250+
name: 'pour',
251+
inputs: [
252+
{
253+
type: 'bytes12',
254+
name: 'vaultId_',
255+
},
256+
{
257+
type: 'address',
258+
name: 'to',
259+
},
260+
{
261+
type: 'int128',
262+
name: 'ink',
263+
},
264+
{
265+
type: 'int128',
266+
name: 'art',
267+
},
268+
],
269+
},
270+
params: [
271+
'0x000000000000000000000000',
272+
'0x0000000000000000000000000000000000000000',
273+
'170141183460469231731687303715884105727',
274+
'-170141183460469231731687303715884105727',
275+
],
276+
},
277+
output: '0x99d4294000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80000000000000000000000000000001',
278+
},
246279
];
247280

248281
export const inValidFunctionsCalls: { input: any; output: string }[] = [
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
/*
2+
This file is part of web3.js.
3+
4+
web3.js is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU Lesser General Public License as published by
6+
the Free Software Foundation, either version 3 of the License, or
7+
(at your option) any later version.
8+
9+
web3.js is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public License
15+
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
import Contract from '../../src';
18+
import { createTempAccount, getSystemTestProvider } from '../fixtures/system_test_utils';
19+
import {
20+
NegativeNumbersAbi,
21+
NegativeNumbersBytecode,
22+
} from '../shared_fixtures/build/NegativeNumbers';
23+
24+
describe('Contract - NegativeNumbers.sol', () => {
25+
const storedNegativeNumber = '-170141183460469231731687303715884105727';
26+
27+
let contract: Contract<typeof NegativeNumbersAbi>;
28+
let contractDeployed: Contract<typeof NegativeNumbersAbi>;
29+
let account: Record<string, string>;
30+
let sendOptions: Record<string, string>;
31+
32+
beforeAll(async () => {
33+
contract = new Contract(NegativeNumbersAbi, undefined, {
34+
provider: getSystemTestProvider(),
35+
});
36+
account = await createTempAccount();
37+
38+
const deployOptions: Record<string, unknown> = {
39+
data: NegativeNumbersBytecode,
40+
arguments: [storedNegativeNumber],
41+
};
42+
sendOptions = {
43+
from: account.address,
44+
gas: '1000000',
45+
};
46+
47+
contractDeployed = await contract.deploy(deployOptions).send(sendOptions);
48+
});
49+
50+
it('should retrieve storedNegativeNumber', async () => {
51+
const response = await contractDeployed.methods.storedNegativeNumber().call();
52+
expect(response).toBe(BigInt(storedNegativeNumber));
53+
});
54+
55+
it('should return storedNegativeNumber when calling oneNegativeNumber(storedNegativeNumber)', async () => {
56+
const transactionReceipt = await contractDeployed.methods
57+
.oneNegativeNumber(storedNegativeNumber)
58+
.send(sendOptions);
59+
60+
expect(transactionReceipt.logs).toMatchObject([
61+
{
62+
topics: ['0x5b53dc4e9e8fa2416d4e172bdad04be5a6d622643bc9ef45987b2caadd0d0c95'],
63+
data: '0xffffffffffffffffffffffffffffffff80000000000000000000000000000001',
64+
},
65+
{
66+
topics: [
67+
'0x33e7dccd3899498f4408d6468e5dfad650f32574dba2ec4f13399a82e62166d5',
68+
'0xffffffffffffffffffffffffffffffff80000000000000000000000000000001',
69+
],
70+
data: '0x',
71+
},
72+
]);
73+
});
74+
75+
it('should return storedNegativeNumber when calling twoNegativeNumbers(storedNegativeNumber, secondNegativeNumber)', async () => {
76+
const secondNegativeNumber =
77+
'-17014118346046923173168730371588410572712039182039812039812098312';
78+
79+
const transactionReceipt = await contractDeployed.methods
80+
.twoNegativeNumbers(storedNegativeNumber, secondNegativeNumber)
81+
.send(sendOptions);
82+
83+
expect(transactionReceipt.logs).toMatchObject([
84+
{
85+
topics: ['0xfaa997e4b16dcde196bbb99868e16fa934a0b4c1f019e494d9fbffb5abc46fc2'],
86+
data: '0xffffffffffffffffffffffffffffffff80000000000000000000000000000001ffffffffffd6a416919bf9968e000000000000000048c26d7f0da3fa91bf56f8',
87+
},
88+
{
89+
topics: [
90+
'0x0204c97becd72594486cf753e30e8acfc9951ee663e404bc858e3d10b80da99b',
91+
'0xffffffffffffffffffffffffffffffff80000000000000000000000000000001',
92+
'0xffffffffffd6a416919bf9968e000000000000000048c26d7f0da3fa91bf56f8',
93+
],
94+
data: '0x',
95+
},
96+
]);
97+
});
98+
99+
it('should return storedNegativeNumber when calling otherNegativeNumbers(storedNegativeNumber, secondNegativeNumber)', async () => {
100+
const secondNegativeNumber =
101+
'-17014118346046923173168730371588410572712039182039812039812098312';
102+
103+
const transactionReceipt = await contractDeployed.methods
104+
.otherNegativeNumbers(storedNegativeNumber, secondNegativeNumber, 'fooBar')
105+
.send(sendOptions);
106+
107+
expect(transactionReceipt.logs).toMatchObject([
108+
{
109+
topics: ['0x2e1fb99ee1b27b6491b2d46a54ac8daca82f2da6810e4b8eed4d634f78fa6948'],
110+
data: '0xffffffffffffffffffffffffffffffff80000000000000000000000000000001ffffffffffd6a416919bf9968e000000000000000048c26d7f0da3fa91bf56f800000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000006666f6f4261720000000000000000000000000000000000000000000000000000',
111+
},
112+
{
113+
topics: [
114+
'0x0e29b573959c1b6ffd5e16886385ec1732e187cc5ac10e8faceb5e02a1c7b50b',
115+
'0xffffffffffffffffffffffffffffffff80000000000000000000000000000001',
116+
'0xffffffffffd6a416919bf9968e000000000000000048c26d7f0da3fa91bf56f8',
117+
],
118+
data: '0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000006666f6f4261720000000000000000000000000000000000000000000000000000',
119+
},
120+
]);
121+
});
122+
});

0 commit comments

Comments
 (0)
This repository has been archived.