git.delta.rocks / unique-network / refs/commits / 898c743eda26

difftreelog

fixed code review issues

Grigoriy Simonov2022-07-22parent: #0f86ef0.patch.diff
in: master

8 files changed

modifiedMakefilediffbeforeafterboth
36 PACKAGE=pallet-nonfungible NAME=erc::gen_impl OUTPUT=$(NONFUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh36 PACKAGE=pallet-nonfungible NAME=erc::gen_impl OUTPUT=$(NONFUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh
37 37
38UniqueRefungibleToken.sol:38UniqueRefungibleToken.sol:
39 PACKAGE=pallet-refungible NAME=erc20::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh39 PACKAGE=pallet-refungible NAME=erc_token::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh
40 PACKAGE=pallet-refungible NAME=erc20::gen_impl OUTPUT=$(REFUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh40 PACKAGE=pallet-refungible NAME=erc_token::gen_impl OUTPUT=$(REFUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh
4141
42ContractHelpers.sol:42ContractHelpers.sol:
43 PACKAGE=pallet-evm-contract-helpers NAME=eth::contract_helpers_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh43 PACKAGE=pallet-evm-contract-helpers NAME=eth::contract_helpers_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh
addedpallets/refungible/src/erc.rsdiffbeforeafterboth

no changes

deletedpallets/refungible/src/erc20.rsdiffbeforeafterboth

no changes

deletedpallets/refungible/src/erc721.rsdiffbeforeafterboth

no changes

addedpallets/refungible/src/erc_token.rsdiffbeforeafterboth

no changes

modifiedpallets/refungible/src/lib.rsdiffbeforeafterboth
8787
88#![cfg_attr(not(feature = "std"), no_std)]88#![cfg_attr(not(feature = "std"), no_std)]
8989
90use crate::erc20::ERC20Events;90use crate::erc_token::ERC20Events;
9191
92use codec::{Encode, Decode, MaxEncodedLen};92use codec::{Encode, Decode, MaxEncodedLen};
93use core::ops::Deref;93use core::ops::Deref;
110#[cfg(feature = "runtime-benchmarks")]110#[cfg(feature = "runtime-benchmarks")]
111pub mod benchmarking;111pub mod benchmarking;
112pub mod common;112pub mod common;
113pub mod erc20;113pub mod erc;
114pub mod erc721;114pub mod erc_token;
115pub mod weights;115pub mod weights;
116pub(crate) type SelfWeightOf<T> = <T as Config>::WeightInfo;116pub(crate) type SelfWeightOf<T> = <T as Config>::WeightInfo;
117117
modifiedruntime/common/src/dispatch.rsdiffbeforeafterboth
25pub use pallet_common::dispatch::CollectionDispatch;25pub use pallet_common::dispatch::CollectionDispatch;
26use pallet_fungible::{Pallet as PalletFungible, FungibleHandle};26use pallet_fungible::{Pallet as PalletFungible, FungibleHandle};
27use pallet_nonfungible::{Pallet as PalletNonfungible, NonfungibleHandle};27use pallet_nonfungible::{Pallet as PalletNonfungible, NonfungibleHandle};
28use pallet_refungible::{Pallet as PalletRefungible, RefungibleHandle, erc20::RefungibleTokenHandle};28use pallet_refungible::{
29 Pallet as PalletRefungible, RefungibleHandle, erc_token::RefungibleTokenHandle,
30};
29use up_data_structs::{31use up_data_structs::{
30 CollectionMode, CreateCollectionData, MAX_DECIMAL_POINTS, mapping::TokenAddressMapping,32 CollectionMode, CreateCollectionData, MAX_DECIMAL_POINTS, mapping::TokenAddressMapping,
modifiedtests/src/eth/reFungibleToken.test.tsdiffbeforeafterboth
56 expect(balance).to.equal('200');56 expect(balance).to.equal('200');
57 });57 });
58
59 itWeb3('decimals', async ({api, web3, privateKeyWrapper}) => {
60 const alice = privateKeyWrapper('//Alice');
61
62 const collectionId = (await createCollection(api, alice, {name: 'token name', mode: {type: 'ReFungible'}})).collectionId;
63
64 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
65
66 const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: caller})).itemId;
67
68 const address = tokenIdToAddress(collectionId, tokenId);
69 const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: caller, ...GAS_ARGS});
70 const decimals = await contract.methods.decimals().call();
71
72 expect(decimals).to.equal('0');
73 });
58});74});
5975
60describe('Refungible: Plain calls', () => {76describe('Refungible: Plain calls', () => {