Eth-connector: change total_supply behaviour. Refactoring.#136
Conversation
mfornet
left a comment
There was a problem hiding this comment.
I appreciate this level of verbosity for function names. Using functions like ft_total_supply_near was not useful to understand what was happening there.
* `ft_total_supply()` now represents the amount of nETH (ETH NEP-141 tokens on NEAR) to correspond to NEP-141 standard. * Rename `ft_total_supply_near()` -> `ft_total_eth_supply_on_near()`. * Rename `ft_total_supply_eth()` -> `ft_total_supply_eth_on_near()`. * Rename `finish_deposit_near()` -> `finish_deposit()`. * `deposit()` method refactoring. * Minor refactoring. * Fix tests according to changes and refactoring.
Co-authored-by: Marcelo Fornet <mfornet94@gmail.com>
2702729 to
87829de
Compare
|
@artob rebase is finished. |
|
Update: |
|
@mrLSD If we look at the Near and Aurora as separate entities (not taking into account that Aurora EVM is inside the Near account), we can say that there are no Aurora accounts on Near and vice versa. So I think the naming is quite clear if we get used to it. |
For me, it's not clear how it affects current accounts balance logic.
It doesn't mean that if we already use that naming anywhere that naming is clear. |
joshuajbouw
left a comment
There was a problem hiding this comment.
Straight forward. Thanks for this.
…gine into eth-connector-total-supply-changes-and-refactoring
mfornet
left a comment
There was a problem hiding this comment.
Great, much easier to use this names.
…gine into eth-connector-total-supply-changes-and-refactoring
The idea for these names is to represent these balances from a top-level conceptual point of view. We don't want to have very detailed implementation specifics represented in function names. I think having top-level abstractions is a good approach. |
|
@artob merged. Please check! |
* Introduce precompiles for the ETH & ERC-20 connectors. (#51) * Implement generational storage with `SELFDESTRUCT` tests. (#84) * Remove the dependency on Lunarity. (#115) * Fix Clippy complaint with `+nightly`. (#117) * Simplify the `sdk::read_u64` return type. (#118) * Add an `is_used_proof` interface. (#120) * Add an `evm-bully=yes` build to CI. (#121) * Handle transaction gas limit properly. (#123) * Fix u128 JSON parsing & tests in the ETH connector. (#125) * Fix evm-bully builds. (#130) * Add JSON custom error types. (#131) * Don't burn NEP-141 on deposit. (#133) * Fix needless borrows. (#135) * Improve and refactor the ETH connector. (#136) * Add a macro for logging. (#142) Co-authored-by: Aleksey Kladov <aleksey@near.org> Co-authored-by: Arto Bendiken <arto@aurora.dev> Co-authored-by: Evgeny Ukhanov <evgeny@aurora.dev> Co-authored-by: Frank Braun <frank@aurora.dev> Co-authored-by: Joshua J. Bouw <joshua@aurora.dev> Co-authored-by: Kirill <kirill@aurora.dev> Co-authored-by: Marcelo Fornet <marcelo@aurora.dev> Co-authored-by: Michael Birch <michael@aurora.dev>
* Introduce precompiles for the ETH & ERC-20 connectors. (#51) * Implement generational storage with `SELFDESTRUCT` tests. (#84) * Fix u128 JSON parsing & tests in the ETH connector. (#125) * Add JSON custom error types. (#131) * Don't burn NEP-141 on deposit. (#133) * Fix needless borrows. (#135) * Improve and refactor the ETH connector. (#136) * Add a macro for logging. (#142) Co-authored-by: Aleksey Kladov <aleksey@near.org> Co-authored-by: Arto Bendiken <arto@aurora.dev> Co-authored-by: Evgeny Ukhanov <evgeny@aurora.dev> Co-authored-by: Frank Braun <frank@aurora.dev> Co-authored-by: Joshua J. Bouw <joshua@aurora.dev> Co-authored-by: Kirill <kirill@aurora.dev> Co-authored-by: Marcelo Fornet <marcelo@aurora.dev> Co-authored-by: Michael Birch <michael@aurora.dev>
This is a follow-up to #133 PR. This is required as that PR contains needed changes so we won't fix tests twice just to make CI pass. Once that PR is merged, the current one needs to be rebased on top of
developbranch.Following our discussion with @mfornet, we need to change the
ft_total_supplymeaning to correspond to the NEP-141 standard. Also, some other refactoring was required as many members of the team frequently get confusing withft_total_supply_nearthinking that this represents bridged Near to Aurora (which we don't have) and other similar things.Please note, that this PR most likely will require state migration as inner fields of the
FungibleTokenstructure were renamed. However, this should be ok on Mainnet as we don't have an eth-connector available there.Changes:
ft_total_supply()now represents the amount of nETH (ETH NEP-141 tokens on NEAR) to correspond to NEP-141 standard.FungibleToken: renametotal_supplyfield ->total_eth_supply_on_near.FungibleToken: renametotal_supply_ethfield ->total_eth_supply_on_aurora.ft_total_supply_near()->ft_total_eth_supply_on_near().ft_total_supply_eth()->ft_total_supply_eth_on_near().finish_deposit_near()->finish_deposit().deposit()method refactoring.