git.delta.rocks / unique-network / refs/commits / 8a13a05ca7b7

difftreelog

Add new storage field in contract V2

Grigoriy Simonov2022-10-03parent: #ea8fa39.patch.diff
in: master

1 file changed

modifiedtests/src/eth/proxyContract.test.tsdiffbeforeafterboth
5151
52 await realContractV2proxy.methods.flip().send();52 await realContractV2proxy.methods.flip().send();
53 await realContractV2proxy.methods.flip().send();53 await realContractV2proxy.methods.flip().send();
54 await realContractV2proxy.methods.setStep(5).send();
54 await realContractV2proxy.methods.increaseFlipCount().send();55 await realContractV2proxy.methods.increaseFlipCount().send();
55 const value2 = await realContractV2proxy.methods.getValue().call();56 const value2 = await realContractV2proxy.methods.getValue().call();
56 const flipCount2 = await realContractV2proxy.methods.getFlipCount().call();57 const flipCount2 = await realContractV2proxy.methods.getFlipCount().call();
123 }124 }
124125
125 async function deployRealContractV2(helper: EthUniqueHelper, deployer: string) {126 async function deployRealContractV2(helper: EthUniqueHelper, deployer: string) {
126 return await helper.ethContract.deployByCode(deployer, 'RealContractV2', `127 return await helper.ethContract.deployByCode(deployer, 'RealContractV2', `
127 // SPDX-License-Identifier: UNLICENSED128 // SPDX-License-Identifier: UNLICENSED
128 pragma solidity ^0.8.6;129 pragma solidity ^0.8.6;
129 130
130 contract RealContractV2 {131 contract RealContractV2 {
131 bool value = false;132 bool value = false;
132 uint flipCount = 10;133 uint flipCount = 10;
133 function flip() external {134 uint step = 1;
135 function flip() external {
134 value = !value;136 value = !value;
135 flipCount--;137 flipCount--;
136 }138 }
137 function increaseFlipCount() external {139 function setStep(uint value) external {
140 step = value;
141 }
142 function increaseFlipCount() external {
138 flipCount = flipCount + 5;143 flipCount = flipCount + step;
139 }144 }
140 function getValue() external view returns (bool) {145 function getValue() external view returns (bool) {
141 return value;146 return value;
142 }147 }
143 function getFlipCount() external view returns (uint) {148 function getFlipCount() external view returns (uint) {
144 return flipCount;149 return flipCount;
145 }150 }
146 }`);151 }`);
147 }152 }
148});153});