git.delta.rocks / unique-network / refs/commits / 8900b85b9a67

difftreelog

misk: Change OptionCrossAddress to Option<CrossAddress>

Trubnikov Sergey2023-01-10parent: #72d7965.patch.diff
in: master

6 files changed

modifiedpallets/common/src/eth.rsdiffbeforeafterboth
66 T::CrossAccountId::from_sub(account_id)66 T::CrossAccountId::from_sub(account_id)
67}67}
68
69/// Ethereum representation of Optional value with CrossAddress.
70#[derive(Debug, Default, AbiCoder)]
71pub struct OptionCrossAddress {
72 /// Whether or not this CrossAdress is valid and has meaning.
73 pub status: bool,
74 /// The underlying CrossAddress value. If the status is false, can be set to whatever.
75 pub value: CrossAddress,
76}
7768
78/// Cross account struct69/// Cross account struct
79#[derive(Debug, Default, AbiCoder)]70#[derive(Debug, Default, AbiCoder)]
modifiedpallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth
175 ///175 ///
176 /// @param contractAddress The contract for which a sponsor is requested.176 /// @param contractAddress The contract for which a sponsor is requested.
177 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.177 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
178 fn sponsor(&self, contract_address: address) -> Result<eth::OptionCrossAddress> {178 fn sponsor(&self, contract_address: address) -> Result<Option<eth::CrossAddress>> {
179 Ok(match Pallet::<T>::get_sponsor(contract_address) {179 Ok(match Pallet::<T>::get_sponsor(contract_address) {
180 Some(ref value) => eth::OptionCrossAddress {180 Some(ref value) => Some(eth::CrossAddress::from_sub_cross_account::<T>(value)),
181 status: true,
182 value: eth::CrossAddress::from_sub_cross_account::<T>(value),
183 },
184 None => eth::OptionCrossAddress {181 None => None,
185 status: false,
186 value: Default::default(),
187 },
188 })182 })
189 }183 }
190184
modifiedpallets/evm-contract-helpers/src/stubs/ContractHelpers.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/evm-contract-helpers/src/stubs/ContractHelpers.soldiffbeforeafterboth
96 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.96 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
97 /// @dev EVM selector for this function is: 0x766c4f37,97 /// @dev EVM selector for this function is: 0x766c4f37,
98 /// or in textual repr: sponsor(address)98 /// or in textual repr: sponsor(address)
99 function sponsor(address contractAddress) public view returns (OptionCrossAddress memory) {99 function sponsor(address contractAddress) public view returns (Option_CrossAddress memory) {
100 require(false, stub_error);100 require(false, stub_error);
101 contractAddress;101 contractAddress;
102 dummy;102 dummy;
103 return OptionCrossAddress(false, CrossAddress(0x0000000000000000000000000000000000000000, 0));103 return Option_CrossAddress(false, CrossAddress(0x0000000000000000000000000000000000000000, 0));
104 }104 }
105105
106 /// Check tat contract has confirmed sponsor.106 /// Check tat contract has confirmed sponsor.
281 uint256 sub;281 uint256 sub;
282}282}
283283
284/// Ethereum representation of Optional value with CrossAddress.284/// Optional value
285struct OptionCrossAddress {285struct Option_CrossAddress {
286 /// Whether or not this CrossAdress is valid and has meaning.286 /// Shows the status of accessibility of value
287 bool status;287 bool status;
288 /// The underlying CrossAddress value. If the status is false, can be set to whatever.288 /// Actual value if `status` is true
289 CrossAddress value;289 CrossAddress value;
290}290}
291291
modifiedtests/src/eth/abi/contractHelpers.jsondiffbeforeafterboth
238 "type": "tuple"238 "type": "tuple"
239 }239 }
240 ],240 ],
241 "internalType": "struct OptionCrossAddress",241 "internalType": "struct Option_CrossAddress",
242 "name": "",242 "name": "",
243 "type": "tuple"243 "type": "tuple"
244 }244 }
modifiedtests/src/eth/api/ContractHelpers.soldiffbeforeafterboth
69 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.69 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
70 /// @dev EVM selector for this function is: 0x766c4f37,70 /// @dev EVM selector for this function is: 0x766c4f37,
71 /// or in textual repr: sponsor(address)71 /// or in textual repr: sponsor(address)
72 function sponsor(address contractAddress) external view returns (OptionCrossAddress memory);72 function sponsor(address contractAddress) external view returns (Option_CrossAddress memory);
7373
74 /// Check tat contract has confirmed sponsor.74 /// Check tat contract has confirmed sponsor.
75 ///75 ///
181 Generous181 Generous
182}182}
183183
184/// Ethereum representation of Optional value with CrossAddress.184/// Optional value
185struct OptionCrossAddress {185struct Option_CrossAddress {
186 /// Whether or not this CrossAdress is valid and has meaning.186 /// Shows the status of accessibility of value
187 bool status;187 bool status;
188 /// The underlying CrossAddress value. If the status is false, can be set to whatever.188 /// Actual value if `status` is true
189 CrossAddress value;189 CrossAddress value;
190}190}
191191