git.delta.rocks / unique-network / refs/commits / 057ef8c1c468

difftreelog

fix fungible amount is not indexed

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

1 file changed

modifiedpallets/nft/src/eth/mod.rsdiffbeforeafterboth
263pub const APPROVAL_NFT_TOPIC: H256 = H256(hex_literal::hex!("8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925"));263pub const APPROVAL_NFT_TOPIC: H256 = H256(hex_literal::hex!("8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925"));
264// TODO: event ApprovalForAll(address indexed owner, address indexed operator, bool approved);264// TODO: event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
265265
266/// event Transfer(address indexed from, address indexed to, uint256 indexed amount);266/// event Transfer(address indexed from, address indexed to, uint256 amount);
267pub const TRANSFER_FUNGIBLE_TOPIC: H256 = H256(hex_literal::hex!("ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"));267pub const TRANSFER_FUNGIBLE_TOPIC: H256 = H256(hex_literal::hex!("ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"));
268/// event Approval(address indexed owner, address indexed approved, uint256 indexed amount);268/// event Approval(address indexed owner, address indexed approved, uint256 amount);
269pub const APPROVAL_FUNGIBLE_TOPIC: H256 = H256(hex_literal::hex!("8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925"));269pub const APPROVAL_FUNGIBLE_TOPIC: H256 = H256(hex_literal::hex!("8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925"));
270270
271pub fn address_to_topic(address: &H160) -> H256 {271pub fn address_to_topic(address: &H160) -> H256 {
274 H256(output)274 H256(output)
275}275}
276
277pub fn u32_to_topic(id: u32) -> H256 {
278 let mut output = [0; 32];
279 output[28..32].copy_from_slice(&id.to_be_bytes());
280 H256(output)
281}
276282
277283
278// TODO: This function is slow, and output can be memoized284// TODO: This function is slow, and output can be memoized