git.delta.rocks / unique-network / refs/commits / 231992803ffe

difftreelog

fix rename some methods

Trubnikov Sergey2022-09-19parent: #b85120e.patch.diff
in: master

6 files changed

modifiedpallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth
--- a/pallets/evm-contract-helpers/src/eth.rs
+++ b/pallets/evm-contract-helpers/src/eth.rs
@@ -169,7 +169,7 @@
 	///
 	/// @param contractAddress The contract for which a sponsor is requested.
 	/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
-	fn get_sponsor(&self, contract_address: address) -> Result<(address, uint256)> {
+	fn sponsor(&self, contract_address: address) -> Result<(address, uint256)> {
 		let sponsor =
 			Pallet::<T>::get_sponsor(contract_address).ok_or("Contract has no sponsor")?;
 		Ok(pallet_common::eth::convert_cross_account_to_tuple::<T>(
@@ -220,7 +220,7 @@
 	/// Get current contract sponsoring rate limit
 	/// @param contractAddress Contract to get sponsoring rate limit of
 	/// @return uint32 Amount of blocks between two sponsored transactions
-	fn get_sponsoring_rate_limit(&self, contract_address: address) -> Result<uint32> {
+	fn sponsoring_rate_limit(&self, contract_address: address) -> Result<uint32> {
 		self.recorder().consume_sload()?;
 
 		Ok(<SponsoringRateLimit<T>>::get(contract_address)
@@ -273,7 +273,7 @@
 	/// @param contractAddress Contract to get sponsoring fee limit of
 	/// @return uint256 Maximum amount of fee that could be spent by single
 	///  transaction
-	fn get_sponsoring_fee_limit(&self, contract_address: address) -> Result<uint256> {
+	fn sponsoring_fee_limit(&self, contract_address: address) -> Result<uint256> {
 		self.recorder().consume_sload()?;
 
 		Ok(get_sponsoring_fee_limit::<T>(contract_address))
modifiedpallets/evm-contract-helpers/src/stubs/ContractHelpers.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/evm-contract-helpers/src/stubs/ContractHelpers.soldiffbeforeafterboth
--- a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol
+++ b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol
@@ -25,7 +25,7 @@
 }
 
 /// @title Magic contract, which allows users to reconfigure other contracts
-/// @dev the ERC-165 identifier for this interface is 0x172cb4fb
+/// @dev the ERC-165 identifier for this interface is 0x30afad04
 contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents {
 	/// Get user, which deployed specified contract
 	/// @dev May return zero address in case if contract is deployed
@@ -94,9 +94,9 @@
 	///
 	/// @param contractAddress The contract for which a sponsor is requested.
 	/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
-	/// @dev EVM selector for this function is: 0x743fc745,
-	///  or in textual repr: getSponsor(address)
-	function getSponsor(address contractAddress) public view returns (Tuple0 memory) {
+	/// @dev EVM selector for this function is: 0x766c4f37,
+	///  or in textual repr: sponsor(address)
+	function sponsor(address contractAddress) public view returns (Tuple0 memory) {
 		require(false, stub_error);
 		contractAddress;
 		dummy;
@@ -150,9 +150,9 @@
 	/// Get current contract sponsoring rate limit
 	/// @param contractAddress Contract to get sponsoring rate limit of
 	/// @return uint32 Amount of blocks between two sponsored transactions
-	/// @dev EVM selector for this function is: 0x610cfabd,
-	///  or in textual repr: getSponsoringRateLimit(address)
-	function getSponsoringRateLimit(address contractAddress) public view returns (uint32) {
+	/// @dev EVM selector for this function is: 0xf29694d8,
+	///  or in textual repr: sponsoringRateLimit(address)
+	function sponsoringRateLimit(address contractAddress) public view returns (uint32) {
 		require(false, stub_error);
 		contractAddress;
 		dummy;
@@ -193,9 +193,9 @@
 	/// @param contractAddress Contract to get sponsoring fee limit of
 	/// @return uint256 Maximum amount of fee that could be spent by single
 	///  transaction
-	/// @dev EVM selector for this function is: 0xc3fdc9ee,
-	///  or in textual repr: getSponsoringFeeLimit(address)
-	function getSponsoringFeeLimit(address contractAddress) public view returns (uint256) {
+	/// @dev EVM selector for this function is: 0x75b73606,
+	///  or in textual repr: sponsoringFeeLimit(address)
+	function sponsoringFeeLimit(address contractAddress) public view returns (uint256) {
 		require(false, stub_error);
 		contractAddress;
 		dummy;
modifiedtests/src/eth/api/ContractHelpers.soldiffbeforeafterboth
--- a/tests/src/eth/api/ContractHelpers.sol
+++ b/tests/src/eth/api/ContractHelpers.sol
@@ -20,7 +20,7 @@
 }
 
 /// @title Magic contract, which allows users to reconfigure other contracts
-/// @dev the ERC-165 identifier for this interface is 0x172cb4fb
+/// @dev the ERC-165 identifier for this interface is 0x30afad04
 interface ContractHelpers is Dummy, ERC165, ContractHelpersEvents {
 	/// Get user, which deployed specified contract
 	/// @dev May return zero address in case if contract is deployed
@@ -67,9 +67,9 @@
 	///
 	/// @param contractAddress The contract for which a sponsor is requested.
 	/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
-	/// @dev EVM selector for this function is: 0x743fc745,
-	///  or in textual repr: getSponsor(address)
-	function getSponsor(address contractAddress) external view returns (Tuple0 memory);
+	/// @dev EVM selector for this function is: 0x766c4f37,
+	///  or in textual repr: sponsor(address)
+	function sponsor(address contractAddress) external view returns (Tuple0 memory);
 
 	/// Check tat contract has confirmed sponsor.
 	///
@@ -98,9 +98,9 @@
 	/// Get current contract sponsoring rate limit
 	/// @param contractAddress Contract to get sponsoring rate limit of
 	/// @return uint32 Amount of blocks between two sponsored transactions
-	/// @dev EVM selector for this function is: 0x610cfabd,
-	///  or in textual repr: getSponsoringRateLimit(address)
-	function getSponsoringRateLimit(address contractAddress) external view returns (uint32);
+	/// @dev EVM selector for this function is: 0xf29694d8,
+	///  or in textual repr: sponsoringRateLimit(address)
+	function sponsoringRateLimit(address contractAddress) external view returns (uint32);
 
 	/// Set contract sponsoring rate limit
 	/// @dev Sponsoring rate limit - is a minimum amount of blocks that should
@@ -126,9 +126,9 @@
 	/// @param contractAddress Contract to get sponsoring fee limit of
 	/// @return uint256 Maximum amount of fee that could be spent by single
 	///  transaction
-	/// @dev EVM selector for this function is: 0xc3fdc9ee,
-	///  or in textual repr: getSponsoringFeeLimit(address)
-	function getSponsoringFeeLimit(address contractAddress) external view returns (uint256);
+	/// @dev EVM selector for this function is: 0x75b73606,
+	///  or in textual repr: sponsoringFeeLimit(address)
+	function sponsoringFeeLimit(address contractAddress) external view returns (uint256);
 
 	/// Is specified user present in contract allow list
 	/// @dev Contract owner always implicitly included
modifiedtests/src/eth/contractSponsoring.test.tsdiffbeforeafterboth
--- a/tests/src/eth/contractSponsoring.test.ts
+++ b/tests/src/eth/contractSponsoring.test.ts
@@ -223,7 +223,7 @@
     const helpers = contractHelpers(web3, owner);
     await helpers.methods.selfSponsoredEnable(flipper.options.address).send();
     
-    const result = await helpers.methods.getSponsor(flipper.options.address).call();
+    const result = await helpers.methods.sponsor(flipper.options.address).call();
 
     expect(result[0]).to.be.eq(flipper.options.address);
     expect(result[1]).to.be.eq('0');
@@ -237,7 +237,7 @@
     await helpers.methods.setSponsor(flipper.options.address, sponsor).send();
     await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor});
     
-    const result = await helpers.methods.getSponsor(flipper.options.address).call();
+    const result = await helpers.methods.sponsor(flipper.options.address).call();
 
     expect(result[0]).to.be.eq(sponsor);
     expect(result[1]).to.be.eq('0');
@@ -482,7 +482,7 @@
     const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const flipper = await deployFlipper(web3, owner);
     const helpers = contractHelpers(web3, owner);
-    expect(await helpers.methods.getSponsoringRateLimit(flipper.options.address).call()).to.be.equals('7200');
+    expect(await helpers.methods.sponsoringRateLimit(flipper.options.address).call()).to.be.equals('7200');
   });
 });
 
@@ -551,7 +551,7 @@
     const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const flipper = await deployFlipper(web3, owner);
     const helpers = contractHelpers(web3, owner);
-    expect(await helpers.methods.getSponsoringFeeLimit(flipper.options.address).call()).to.be.equals('115792089237316195423570985008687907853269984665640564039457584007913129639935');
+    expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equals('115792089237316195423570985008687907853269984665640564039457584007913129639935');
   });
 
   itWeb3('Set fee limit', async ({api, web3, privateKeyWrapper}) => {
@@ -559,7 +559,7 @@
     const flipper = await deployFlipper(web3, owner);
     const helpers = contractHelpers(web3, owner);
     await helpers.methods.setSponsoringFeeLimit(flipper.options.address, 100).send();
-    expect(await helpers.methods.getSponsoringFeeLimit(flipper.options.address).call()).to.be.equals('100');
+    expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equals('100');
   });
 
   itWeb3('Negative test - set fee limit by non-owner', async ({api, web3, privateKeyWrapper}) => {
modifiedtests/src/eth/util/contractHelpersAbi.jsondiffbeforeafterboth
103 "stateMutability": "view",103 "stateMutability": "view",
104 "type": "function"104 "type": "function"
105 },105 },
106 {
107 "inputs": [
108 {
109 "internalType": "address",
110 "name": "contractAddress",
111 "type": "address"
112 }
113 ],
114 "name": "getSponsor",
115 "outputs": [
116 {
117 "components": [
118 { "internalType": "address", "name": "field_0", "type": "address" },
119 { "internalType": "uint256", "name": "field_1", "type": "uint256" }
120 ],
121 "internalType": "struct Tuple0",
122 "name": "",
123 "type": "tuple"
124 }
125 ],
126 "stateMutability": "view",
127 "type": "function"
128 },
129 {
130 "inputs": [
131 {
132 "internalType": "address",
133 "name": "contractAddress",
134 "type": "address"
135 }
136 ],
137 "name": "getSponsoringFeeLimit",
138 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
139 "stateMutability": "view",
140 "type": "function"
141 },
142 {
143 "inputs": [
144 {
145 "internalType": "address",
146 "name": "contractAddress",
147 "type": "address"
148 }
149 ],
150 "name": "getSponsoringRateLimit",
151 "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }],
152 "stateMutability": "view",
153 "type": "function"
154 },
155 {106 {
156 "inputs": [107 "inputs": [
157 {108 {
260 "stateMutability": "nonpayable",211 "stateMutability": "nonpayable",
261 "type": "function"212 "type": "function"
262 },213 },
214 {
215 "inputs": [
216 {
217 "internalType": "address",
218 "name": "contractAddress",
219 "type": "address"
220 }
221 ],
222 "name": "sponsor",
223 "outputs": [
224 {
225 "components": [
226 { "internalType": "address", "name": "field_0", "type": "address" },
227 { "internalType": "uint256", "name": "field_1", "type": "uint256" }
228 ],
229 "internalType": "struct Tuple0",
230 "name": "",
231 "type": "tuple"
232 }
233 ],
234 "stateMutability": "view",
235 "type": "function"
236 },
263 {237 {
264 "inputs": [238 "inputs": [
265 {239 {
273 "stateMutability": "view",247 "stateMutability": "view",
274 "type": "function"248 "type": "function"
275 },249 },
250 {
251 "inputs": [
252 {
253 "internalType": "address",
254 "name": "contractAddress",
255 "type": "address"
256 }
257 ],
258 "name": "sponsoringFeeLimit",
259 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
260 "stateMutability": "view",
261 "type": "function"
262 },
263 {
264 "inputs": [
265 {
266 "internalType": "address",
267 "name": "contractAddress",
268 "type": "address"
269 }
270 ],
271 "name": "sponsoringRateLimit",
272 "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }],
273 "stateMutability": "view",
274 "type": "function"
275 },
276 {276 {
277 "inputs": [277 "inputs": [
278 { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" }278 { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" }