-
Notifications
You must be signed in to change notification settings - Fork 710
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pallet-revive] eth-prc fix geth diff (#6608)
* Add a bunch of differential tests to ensure that responses from eth-rpc matches the one from `geth` - These [tests](https://github.com/paritytech/polkadot-sdk/blob/pg/fix-geth-diff/substrate/frame/revive/rpc/examples/js/src/geth-diff.test.ts) are not run in CI for now but can be run locally with ```bash cd revive/rpc/examples/js bun test ``` * EVM RPC server will not fail gas_estimation if no gas is specified, I updated pallet-revive to add an extra `skip_transfer` boolean check to replicate this behavior in our pallet * `eth_transact` and `bare_eth_transact` api have been updated to use `GenericTransaction` directly as this is what is used by `eth_estimateGas` and `eth_call` ## TODO - [ ] Add tests the new `skip_transfer` flag --------- Co-authored-by: GitHub Action <[email protected]> Co-authored-by: Alexander Theißen <[email protected]>
- Loading branch information
1 parent
5e0bcb0
commit d1fafa8
Showing
55 changed files
with
1,553 additions
and
1,248 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
title: '[pallet-revive] eth-prc fix geth diff' | ||
doc: | ||
- audience: Runtime Dev | ||
description: |- | ||
* Add a bunch of differential tests to ensure that responses from eth-rpc matches the one from `geth` | ||
* EVM RPC server will not fail gas_estimation if no gas is specified, I updated pallet-revive to add an extra `skip_transfer` boolean check to replicate this behavior in our pallet | ||
* `eth_transact` and `bare_eth_transact` api have been updated to use `GenericTransaction` directly as this is what is used by `eth_estimateGas` and `eth_call` | ||
crates: | ||
- name: pallet-revive-eth-rpc | ||
bump: minor | ||
- name: pallet-revive | ||
bump: minor | ||
- name: asset-hub-westend-runtime | ||
bump: minor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
substrate/frame/revive/rpc/examples/js/abi/errorTester.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
export const abi = [ | ||
{ | ||
inputs: [ | ||
{ | ||
internalType: 'string', | ||
name: 'message', | ||
type: 'string', | ||
}, | ||
], | ||
name: 'CustomError', | ||
type: 'error', | ||
}, | ||
{ | ||
inputs: [ | ||
{ | ||
internalType: 'bool', | ||
name: 'newState', | ||
type: 'bool', | ||
}, | ||
], | ||
name: 'setState', | ||
outputs: [], | ||
stateMutability: 'nonpayable', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [], | ||
name: 'state', | ||
outputs: [ | ||
{ | ||
internalType: 'bool', | ||
name: '', | ||
type: 'bool', | ||
}, | ||
], | ||
stateMutability: 'view', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [], | ||
name: 'triggerAssertError', | ||
outputs: [], | ||
stateMutability: 'pure', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [], | ||
name: 'triggerCustomError', | ||
outputs: [], | ||
stateMutability: 'pure', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [], | ||
name: 'triggerDivisionByZero', | ||
outputs: [ | ||
{ | ||
internalType: 'uint256', | ||
name: '', | ||
type: 'uint256', | ||
}, | ||
], | ||
stateMutability: 'pure', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [], | ||
name: 'triggerOutOfBoundsError', | ||
outputs: [ | ||
{ | ||
internalType: 'uint256', | ||
name: '', | ||
type: 'uint256', | ||
}, | ||
], | ||
stateMutability: 'pure', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [], | ||
name: 'triggerRequireError', | ||
outputs: [], | ||
stateMutability: 'pure', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [], | ||
name: 'triggerRevertError', | ||
outputs: [], | ||
stateMutability: 'pure', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [ | ||
{ | ||
internalType: 'uint256', | ||
name: 'value', | ||
type: 'uint256', | ||
}, | ||
], | ||
name: 'valueMatch', | ||
outputs: [], | ||
stateMutability: 'payable', | ||
type: 'function', | ||
}, | ||
] as const |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
export const abi = [ | ||
{ | ||
anonymous: false, | ||
inputs: [ | ||
{ | ||
indexed: true, | ||
internalType: 'address', | ||
name: 'sender', | ||
type: 'address', | ||
}, | ||
{ | ||
indexed: false, | ||
internalType: 'uint256', | ||
name: 'value', | ||
type: 'uint256', | ||
}, | ||
{ | ||
indexed: false, | ||
internalType: 'string', | ||
name: 'message', | ||
type: 'string', | ||
}, | ||
], | ||
name: 'ExampleEvent', | ||
type: 'event', | ||
}, | ||
{ | ||
inputs: [], | ||
name: 'triggerEvent', | ||
outputs: [], | ||
stateMutability: 'nonpayable', | ||
type: 'function', | ||
}, | ||
] as const |
Oops, something went wrong.