From f1d8c4ae7d7d6a42381f0eac96768415c004b71c Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 26 Aug 2022 10:56:02 +0000 Subject: [PATCH] fix: Return erc721 instead erc20 --- --- a/pallets/refungible/src/erc_token.rs +++ b/pallets/refungible/src/erc_token.rs @@ -32,13 +32,13 @@ use evm_coder::{ToLog, execution::*, generate_stubgen, solidity_interface, types::*, weight}; use pallet_common::{ CommonWeightInfo, - erc::{CommonEvmHandler, PrecompileResult}, + erc::{CommonEvmHandler, PrecompileResult}, eth::collection_id_to_address, }; use pallet_evm::{account::CrossAccountId, PrecompileHandle}; use pallet_evm_coder_substrate::{call, dispatch_to_evm, WithRecorder}; use pallet_structure::{SelfWeightOf as StructureWeight, weights::WeightInfo as _}; use sp_std::vec::Vec; -use up_data_structs::{mapping::TokenAddressMapping, TokenId}; +use up_data_structs::TokenId; use crate::{ Allowance, Balance, common::CommonWeights, Config, Pallet, RefungibleHandle, SelfWeightOf, @@ -51,7 +51,7 @@ impl RefungibleTokenHandle { fn parent_token(&self) -> Result
{ self.consume_store_reads(2)?; - Ok(*T::CrossTokenAddressMapping::token_to_address(self.id, self.1).as_eth()) + Ok(collection_id_to_address(self.id)) } fn parent_token_id(&self) -> Result { --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -668,7 +668,7 @@ const tokenAddress = await refungibleTokenContract.methods.parentToken().call(); const tokenId = await refungibleTokenContract.methods.parentTokenId().call(); - expect(tokenAddress).to.be.equal(rftTokenAddress); + expect(tokenAddress).to.be.equal(collectionIdAddress); expect(tokenId).to.be.equal(refungibleTokenId); }); }); -- gitstuff