git.delta.rocks / unique-network / refs/commits / 1e5b2476acbf

difftreelog

feat impl total_suppy

Trubnikov Sergey2023-04-20parent: #0ccc9ea.patch.diff
in: master

1 file changed

modifiedpallets/balances-adapter/src/erc.rsdiffbeforeafterboth
58 fn balance_of(&self, owner: Address) -> Result<U256> {58 fn balance_of(&self, owner: Address) -> Result<U256> {
59 // self.consume_store_reads(1)?;59 // self.consume_store_reads(1)?;
60 let owner = T::CrossAccountId::from_eth(owner);60 let owner = T::CrossAccountId::from_eth(owner);
61 let a = <T as Config>::Currency::free_balance(owner.as_sub());61 let balance = <T as Config>::Currency::free_balance(owner.as_sub());
62 Ok(a.into())62 Ok(balance.into())
63 }63 }
6464
65 fn decimals(&self) -> Result<u8> {65 fn decimals(&self) -> Result<u8> {
7676
77 fn total_supply(&self) -> Result<U256> {77 fn total_supply(&self) -> Result<U256> {
78 // self.consume_store_reads(1)?;78 // self.consume_store_reads(1)?;
79 // Ok(<TotalSupply<T>>::get(self.id).into())
80 todo!()79 let total = <T as Config>::Currency::total_issuance();
80 Ok(total.into())
81 }81 }
8282
83 // #[weight(<SelfWeightOf<T>>::transfer())]83 // #[weight(<SelfWeightOf<T>>::transfer())]