[pallet-revive] Add balance_of syscyall for fetching foreign balances (#5675)
This adds an API method `balance_of`, corresponding to the [BALANCE](https://www.evm.codes/#31?fork=cancun) EVM opcode. In `Ext`, `balance` and `balance_of` are internally routed through the same new `account_balance` method: `balance` is technically the same as `balance_of` with the caller address. This avoids duplicating all the tests and avoids a small inefficiency (in theory, `balance` directly call `balance_of` however this introduces a round trip of converting the target address to a H160 and back). --------- Signed-off-by:Cyrill Leutwiler <bigcyrill@hotmail.com> Signed-off-by:
xermicus <cyrill@parity.io> Co-authored-by: command-bot <>
Showing
- prdoc/pr_5675.prdoc 14 additions, 0 deletionsprdoc/pr_5675.prdoc
- substrate/frame/revive/fixtures/contracts/balance_of.rs 36 additions, 0 deletionssubstrate/frame/revive/fixtures/contracts/balance_of.rs
- substrate/frame/revive/src/benchmarking/mod.rs 20 additions, 0 deletionssubstrate/frame/revive/src/benchmarking/mod.rs
- substrate/frame/revive/src/exec.rs 15 additions, 6 deletionssubstrate/frame/revive/src/exec.rs
- substrate/frame/revive/src/tests.rs 25 additions, 0 deletionssubstrate/frame/revive/src/tests.rs
- substrate/frame/revive/src/wasm/runtime.rs 24 additions, 0 deletionssubstrate/frame/revive/src/wasm/runtime.rs
- substrate/frame/revive/src/weights.rs 21 additions, 0 deletionssubstrate/frame/revive/src/weights.rs
- substrate/frame/revive/uapi/src/host.rs 9 additions, 1 deletionsubstrate/frame/revive/uapi/src/host.rs
- substrate/frame/revive/uapi/src/host/riscv32.rs 5 additions, 0 deletionssubstrate/frame/revive/uapi/src/host/riscv32.rs
Please register or sign in to comment