difftreelog
fix Return erc721 instead erc20
in: master
2 files changed
pallets/refungible/src/erc_token.rsdiffbeforeafterboth32use evm_coder::{ToLog, execution::*, generate_stubgen, solidity_interface, types::*, weight};32use evm_coder::{ToLog, execution::*, generate_stubgen, solidity_interface, types::*, weight};33use pallet_common::{33use pallet_common::{34 CommonWeightInfo,34 CommonWeightInfo,35 erc::{CommonEvmHandler, PrecompileResult},35 erc::{CommonEvmHandler, PrecompileResult}, eth::collection_id_to_address,36};36};37use pallet_evm::{account::CrossAccountId, PrecompileHandle};37use pallet_evm::{account::CrossAccountId, PrecompileHandle};38use pallet_evm_coder_substrate::{call, dispatch_to_evm, WithRecorder};38use pallet_evm_coder_substrate::{call, dispatch_to_evm, WithRecorder};39use pallet_structure::{SelfWeightOf as StructureWeight, weights::WeightInfo as _};39use pallet_structure::{SelfWeightOf as StructureWeight, weights::WeightInfo as _};40use sp_std::vec::Vec;40use sp_std::vec::Vec;41use up_data_structs::{mapping::TokenAddressMapping, TokenId};41use up_data_structs::TokenId;424243use crate::{43use crate::{44 Allowance, Balance, common::CommonWeights, Config, Pallet, RefungibleHandle, SelfWeightOf,44 Allowance, Balance, common::CommonWeights, Config, Pallet, RefungibleHandle, SelfWeightOf,51impl<T: Config> RefungibleTokenHandle<T> {51impl<T: Config> RefungibleTokenHandle<T> {52 fn parent_token(&self) -> Result<address> {52 fn parent_token(&self) -> Result<address> {53 self.consume_store_reads(2)?;53 self.consume_store_reads(2)?;54 Ok(*T::CrossTokenAddressMapping::token_to_address(self.id, self.1).as_eth())54 Ok(collection_id_to_address(self.id))55 }55 }565657 fn parent_token_id(&self) -> Result<uint256> {57 fn parent_token_id(&self) -> Result<uint256> {tests/src/eth/reFungibleToken.test.tsdiffbeforeafterboth668668669 const tokenAddress = await refungibleTokenContract.methods.parentToken().call();669 const tokenAddress = await refungibleTokenContract.methods.parentToken().call();670 const tokenId = await refungibleTokenContract.methods.parentTokenId().call();670 const tokenId = await refungibleTokenContract.methods.parentTokenId().call();671 expect(tokenAddress).to.be.equal(rftTokenAddress);671 expect(tokenAddress).to.be.equal(collectionIdAddress);672 expect(tokenId).to.be.equal(refungibleTokenId);672 expect(tokenId).to.be.equal(refungibleTokenId);673 });673 });674});674});