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

difftreelog

fix nft collection check

Yaroslav Bolyukin2021-05-14parent: #14cafc1.patch.diff
in: master

1 file changed

modifiedpallets/nft/src/eth/mod.rsdiffbeforeafterboth
6060
61fn call_internal<T: Config>(sender: H160, collection: &CollectionHandle<T>, method_id: u32, mut input: AbiReader) -> Result<AbiWriter, Option<&'static str>> {61fn call_internal<T: Config>(sender: H160, collection: &CollectionHandle<T>, method_id: u32, mut input: AbiReader) -> Result<AbiWriter, Option<&'static str>> {
62 let erc20 = matches!(collection.mode, CollectionMode::Fungible(_));62 let erc20 = matches!(collection.mode, CollectionMode::Fungible(_));
63 let erc721 = matches!(collection.mode, CollectionMode::ReFungible);63 let erc721 = matches!(collection.mode, CollectionMode::NFT);
6464
65 Ok(match method_id {65 Ok(match method_id {
66 // function name() external view returns (string memory)66 // function name() external view returns (string memory)
90 } 90 }
91 }91 }
92 // function totalSupply() external view returns (uint256)92 // function totalSupply() external view returns (uint256)
93 0x18160ddd if erc20 => {93 0x18160ddd if erc20 || erc721 => {
94 // TODO: can't be implemented, as we don't track total amount of fungibles94 // TODO: can't be implemented, as we don't track total amount of fungibles
95 crate::abi_encode!(uint256(0))95 crate::abi_encode!(uint256(0))
96 }96 }