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

difftreelog

refac: rename value -> Value

Trubnikov Sergey2023-01-18parent: #64d0cdb.patch.diff
in: master

5 files changed

modifiedcrates/evm-coder/procedural/src/solidity_interface.rsdiffbeforeafterboth
--- a/crates/evm-coder/procedural/src/solidity_interface.rs
+++ b/crates/evm-coder/procedural/src/solidity_interface.rs
@@ -347,7 +347,7 @@
 
 	fn is_value(&self) -> bool {
 		if let Ok(ident) = self.plain() {
-			return ident == "value";
+			return ident == "Value";
 		}
 		false
 	}
modifiedcrates/evm-coder/src/lib.rsdiffbeforeafterboth
--- a/crates/evm-coder/src/lib.rs
+++ b/crates/evm-coder/src/lib.rs
@@ -145,7 +145,7 @@
 
 	//#region Special types
 	/// Makes function payable
-	pub type value = U256;
+	pub type Value = U256;
 	/// Makes function caller-sensitive
 	pub type caller = Address;
 	//#endregion
modifiedcrates/evm-coder/tests/random.rsdiffbeforeafterboth
after · crates/evm-coder/tests/random.rs
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617#![allow(dead_code)] // This test only checks that macros is not panicking1819use evm_coder::{20	abi::AbiType, ToLog, execution::Result, solidity_interface, types::*, solidity, weight,21};22use primitive_types::U256;2324pub struct Impls;2526#[solidity_interface(name = OurInterface)]27impl Impls {28	fn fn_a(&self, _input: U256) -> Result<bool> {29		unreachable!()30	}31}3233#[solidity_interface(name = OurInterface1)]34impl Impls {35	fn fn_b(&self, _input: u128) -> Result<u32> {36		unreachable!()37	}38}3940#[derive(ToLog)]41enum OurEvents {42	Event1 {43		field1: u32,44	},45	Event2 {46		field1: u32,47		#[indexed]48		field2: u32,49	},50}5152#[solidity_interface(53	name = OurInterface2,54	is(OurInterface),55	inline_is(OurInterface1),56	events(OurEvents)57)]58impl Impls {59	#[solidity(rename_selector = "fnK")]60	fn fn_c(&self, _input: u32) -> Result<u8> {61		unreachable!()62	}63	fn fn_d(&self, _value: u32) -> Result<u32> {64		unreachable!()65	}6667	fn caller_sensitive(&self, _caller: caller) -> Result<u8> {68		unreachable!()69	}70	fn payable(&mut self, _value: Value) -> Result<u8> {71		unreachable!()72	}7374	#[weight(*_weight)]75	fn with_weight(&self, _weight: u64) -> Result<()> {76		unreachable!()77	}7879	/// Doccoment example80	fn with_doc(&self) -> Result<()> {81		unreachable!()82	}83}8485#[solidity_interface(86	name = ValidSelector,87	expect_selector = 0x00000000,88)]89impl Impls {}
modifiedpallets/evm-coder-substrate/src/lib.rsdiffbeforeafterboth
--- a/pallets/evm-coder-substrate/src/lib.rs
+++ b/pallets/evm-coder-substrate/src/lib.rs
@@ -41,7 +41,7 @@
 use evm_coder::{
 	abi::{AbiReader, AbiWrite, AbiWriter},
 	execution,
-	types::{Msg, value},
+	types::{Msg, Value},
 };
 
 pub use pallet::*;
@@ -256,7 +256,7 @@
 >(
 	caller: H160,
 	e: &mut E,
-	value: value,
+	value: Value,
 	input: &[u8],
 ) -> execution::Result<Option<AbiWriter>> {
 	let (selector, mut reader) = AbiReader::new_call(input)?;
modifiedpallets/unique/src/eth/mod.rsdiffbeforeafterboth
--- a/pallets/unique/src/eth/mod.rs
+++ b/pallets/unique/src/eth/mod.rs
@@ -88,7 +88,7 @@
 #[inline(always)]
 fn create_collection_internal<T: Config>(
 	caller: caller,
-	value: value,
+	value: Value,
 	name: String,
 	collection_mode: CollectionMode,
 	description: String,
@@ -118,7 +118,7 @@
 	Ok(address)
 }
 
-fn check_sent_amount_equals_collection_creation_price<T: Config>(value: value) -> Result<()> {
+fn check_sent_amount_equals_collection_creation_price<T: Config>(value: Value) -> Result<()> {
 	let value = value.as_u128();
 	let creation_price: u128 = T::CollectionCreationPrice::get()
 		.try_into()
@@ -150,7 +150,7 @@
 	fn create_nft_collection(
 		&mut self,
 		caller: caller,
-		value: value,
+		value: Value,
 		name: String,
 		description: String,
 		token_prefix: String,
@@ -189,7 +189,7 @@
 	fn create_nonfungible_collection(
 		&mut self,
 		caller: caller,
-		value: value,
+		value: Value,
 		name: String,
 		description: String,
 		token_prefix: String,
@@ -209,7 +209,7 @@
 	fn create_rft_collection(
 		&mut self,
 		caller: caller,
-		value: value,
+		value: Value,
 		name: String,
 		description: String,
 		token_prefix: String,
@@ -229,7 +229,7 @@
 	fn create_fungible_collection(
 		&mut self,
 		caller: caller,
-		value: value,
+		value: Value,
 		name: String,
 		decimals: u8,
 		description: String,
@@ -355,7 +355,7 @@
 		Ok(false)
 	}
 
-	fn collection_creation_fee(&self) -> Result<value> {
+	fn collection_creation_fee(&self) -> Result<Value> {
 		let price: u128 = T::CollectionCreationPrice::get()
 			.try_into()
 			.map_err(|_| ()) // workaround for `expect` requiring `Debug` trait