git.delta.rocks / unique-network / refs/commits / ce58d45f1913

difftreelog

misc: Use PascalCase in OptionGeneric name

Trubnikov Sergey2023-01-11parent: #3006d97.patch.diff
in: master

17 files changed

modifiedcrates/evm-coder/src/solidity/impls.rsdiffbeforeafterboth
141141
142impl<T: SolidityTypeName> super::SolidityStructTy for Option<T> {142impl<T: SolidityTypeName> super::SolidityStructTy for Option<T> {
143 fn generate_solidity_interface(tc: &TypeCollector) -> String {143 fn generate_solidity_interface(tc: &TypeCollector) -> String {
144 const option_name: &str = "Option";
145 const option_name_len: usize = option_name.len();
146
147 let to_upper_case_generic_type_name = |s: &mut String| {
148 let c = s
149 .chars()
150 .skip(option_name_len)
151 .next()
152 .expect("Ethereum name must be presented");
153 if c.is_ascii_uppercase() {
154 return;
155 }
156 let uc = String::from(c.to_ascii_uppercase());
157 s.replace_range(option_name_len..option_name_len + 1, uc.as_str());
158 };
159
144 let mut solidity_name = "Option_".to_string();160 let mut solidity_name = option_name.to_string();
145 T::solidity_name(&mut solidity_name, tc);161 T::solidity_name(&mut solidity_name, tc);
146 let solidity_name_str = solidity_name.as_str();162 to_upper_case_generic_type_name(&mut solidity_name);
163
147 let interface = super::SolidityStruct {164 let interface = super::SolidityStruct {
148 docs: &[" Optional value"],165 docs: &[" Optional value"],
149 name: solidity_name_str,166 name: solidity_name.as_str(),
150 fields: (167 fields: (
151 super::SolidityStructField::<bool> {168 super::SolidityStructField::<bool> {
152 docs: &[" Shows the status of accessibility of value"],169 docs: &[" Shows the status of accessibility of value"],
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 (Option_CrossAddress memory) {99 function sponsor(address contractAddress) public view returns (OptionCrossAddress memory) {
100 require(false, stub_error);100 require(false, stub_error);
101 contractAddress;101 contractAddress;
102 dummy;102 dummy;
103 return Option_CrossAddress(false, CrossAddress(0x0000000000000000000000000000000000000000, 0));103 return OptionCrossAddress(false, CrossAddress(0x0000000000000000000000000000000000000000, 0));
104 }104 }
105105
106 /// Check tat contract has confirmed sponsor.106 /// Check tat contract has confirmed sponsor.
282}282}
283283
284/// Optional value284/// Optional value
285struct Option_CrossAddress {285struct OptionCrossAddress {
286 /// Shows the status of accessibility of value286 /// Shows the status of accessibility of value
287 bool status;287 bool status;
288 /// Actual value if `status` is true288 /// Actual value if `status` is true
modifiedpallets/fungible/src/stubs/UniqueFungible.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/fungible/src/stubs/UniqueFungible.soldiffbeforeafterboth
466/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.466/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.
467struct CollectionLimit {467struct CollectionLimit {
468 CollectionLimitField field;468 CollectionLimitField field;
469 Option_uint256 value;469 OptionUint256 value;
470}470}
471471
472/// Optional value472/// Optional value
473struct Option_uint256 {473struct OptionUint256 {
474 /// Shows the status of accessibility of value474 /// Shows the status of accessibility of value
475 bool status;475 bool status;
476 /// Actual value if `status` is true476 /// Actual value if `status` is true
modifiedpallets/nonfungible/src/stubs/UniqueNFT.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth
608/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.608/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.
609struct CollectionLimit {609struct CollectionLimit {
610 CollectionLimitField field;610 CollectionLimitField field;
611 Option_uint256 value;611 OptionUint256 value;
612}612}
613613
614/// Optional value614/// Optional value
615struct Option_uint256 {615struct OptionUint256 {
616 /// Shows the status of accessibility of value616 /// Shows the status of accessibility of value
617 bool status;617 bool status;
618 /// Actual value if `status` is true618 /// Actual value if `status` is true
modifiedpallets/refungible/src/stubs/UniqueRefungible.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth
608/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.608/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.
609struct CollectionLimit {609struct CollectionLimit {
610 CollectionLimitField field;610 CollectionLimitField field;
611 Option_uint256 value;611 OptionUint256 value;
612}612}
613613
614/// Optional value614/// Optional value
615struct Option_uint256 {615struct OptionUint256 {
616 /// Shows the status of accessibility of value616 /// Shows the status of accessibility of value
617 bool status;617 bool status;
618 /// Actual value if `status` is true618 /// Actual value if `status` is true
modifiedtests/src/eth/abi/contractHelpers.jsondiffbeforeafterboth
238 "type": "tuple"238 "type": "tuple"
239 }239 }
240 ],240 ],
241 "internalType": "struct Option_CrossAddress",241 "internalType": "struct OptionCrossAddress",
242 "name": "",242 "name": "",
243 "type": "tuple"243 "type": "tuple"
244 }244 }
modifiedtests/src/eth/abi/fungible.jsondiffbeforeafterboth
222 { "internalType": "bool", "name": "status", "type": "bool" },222 { "internalType": "bool", "name": "status", "type": "bool" },
223 { "internalType": "uint256", "name": "value", "type": "uint256" }223 { "internalType": "uint256", "name": "value", "type": "uint256" }
224 ],224 ],
225 "internalType": "struct Option_uint256",225 "internalType": "struct OptionUint256",
226 "name": "value",226 "name": "value",
227 "type": "tuple"227 "type": "tuple"
228 }228 }
508 { "internalType": "bool", "name": "status", "type": "bool" },508 { "internalType": "bool", "name": "status", "type": "bool" },
509 { "internalType": "uint256", "name": "value", "type": "uint256" }509 { "internalType": "uint256", "name": "value", "type": "uint256" }
510 ],510 ],
511 "internalType": "struct Option_uint256",511 "internalType": "struct OptionUint256",
512 "name": "value",512 "name": "value",
513 "type": "tuple"513 "type": "tuple"
514 }514 }
modifiedtests/src/eth/abi/nonFungible.jsondiffbeforeafterboth
252 { "internalType": "bool", "name": "status", "type": "bool" },252 { "internalType": "bool", "name": "status", "type": "bool" },
253 { "internalType": "uint256", "name": "value", "type": "uint256" }253 { "internalType": "uint256", "name": "value", "type": "uint256" }
254 ],254 ],
255 "internalType": "struct Option_uint256",255 "internalType": "struct OptionUint256",
256 "name": "value",256 "name": "value",
257 "type": "tuple"257 "type": "tuple"
258 }258 }
670 { "internalType": "bool", "name": "status", "type": "bool" },670 { "internalType": "bool", "name": "status", "type": "bool" },
671 { "internalType": "uint256", "name": "value", "type": "uint256" }671 { "internalType": "uint256", "name": "value", "type": "uint256" }
672 ],672 ],
673 "internalType": "struct Option_uint256",673 "internalType": "struct OptionUint256",
674 "name": "value",674 "name": "value",
675 "type": "tuple"675 "type": "tuple"
676 }676 }
modifiedtests/src/eth/abi/reFungible.jsondiffbeforeafterboth
234 { "internalType": "bool", "name": "status", "type": "bool" },234 { "internalType": "bool", "name": "status", "type": "bool" },
235 { "internalType": "uint256", "name": "value", "type": "uint256" }235 { "internalType": "uint256", "name": "value", "type": "uint256" }
236 ],236 ],
237 "internalType": "struct Option_uint256",237 "internalType": "struct OptionUint256",
238 "name": "value",238 "name": "value",
239 "type": "tuple"239 "type": "tuple"
240 }240 }
652 { "internalType": "bool", "name": "status", "type": "bool" },652 { "internalType": "bool", "name": "status", "type": "bool" },
653 { "internalType": "uint256", "name": "value", "type": "uint256" }653 { "internalType": "uint256", "name": "value", "type": "uint256" }
654 ],654 ],
655 "internalType": "struct Option_uint256",655 "internalType": "struct OptionUint256",
656 "name": "value",656 "name": "value",
657 "type": "tuple"657 "type": "tuple"
658 }658 }
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 (Option_CrossAddress memory);72 function sponsor(address contractAddress) external view returns (OptionCrossAddress memory);
7373
74 /// Check tat contract has confirmed sponsor.74 /// Check tat contract has confirmed sponsor.
75 ///75 ///
182}182}
183183
184/// Optional value184/// Optional value
185struct Option_CrossAddress {185struct OptionCrossAddress {
186 /// Shows the status of accessibility of value186 /// Shows the status of accessibility of value
187 bool status;187 bool status;
188 /// Actual value if `status` is true188 /// Actual value if `status` is true
modifiedtests/src/eth/api/UniqueFungible.soldiffbeforeafterboth
308/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.308/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.
309struct CollectionLimit {309struct CollectionLimit {
310 CollectionLimitField field;310 CollectionLimitField field;
311 Option_uint256 value;311 OptionUint256 value;
312}312}
313313
314/// Optional value314/// Optional value
315struct Option_uint256 {315struct OptionUint256 {
316 /// Shows the status of accessibility of value316 /// Shows the status of accessibility of value
317 bool status;317 bool status;
318 /// Actual value if `status` is true318 /// Actual value if `status` is true
modifiedtests/src/eth/api/UniqueNFT.soldiffbeforeafterboth
408/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.408/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.
409struct CollectionLimit {409struct CollectionLimit {
410 CollectionLimitField field;410 CollectionLimitField field;
411 Option_uint256 value;411 OptionUint256 value;
412}412}
413413
414/// Optional value414/// Optional value
415struct Option_uint256 {415struct OptionUint256 {
416 /// Shows the status of accessibility of value416 /// Shows the status of accessibility of value
417 bool status;417 bool status;
418 /// Actual value if `status` is true418 /// Actual value if `status` is true
modifiedtests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth
408/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.408/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.
409struct CollectionLimit {409struct CollectionLimit {
410 CollectionLimitField field;410 CollectionLimitField field;
411 Option_uint256 value;411 OptionUint256 value;
412}412}
413413
414/// Optional value414/// Optional value
415struct Option_uint256 {415struct OptionUint256 {
416 /// Shows the status of accessibility of value416 /// Shows the status of accessibility of value
417 bool status;417 bool status;
418 /// Actual value if `status` is true418 /// Actual value if `status` is true