-
Notifications
You must be signed in to change notification settings - Fork 721
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-rpc add missing tests (#6728)
Add tests for #6608 fix paritytech/contract-issues#12 --------- Co-authored-by: command-bot <>
- Loading branch information
Showing
33 changed files
with
1,019 additions
and
296 deletions.
There are no files selected for viewing
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,12 @@ | ||
title: '[pallet-revive] eth-rpc add missing tests' | ||
doc: | ||
- audience: Runtime Dev | ||
description: |- | ||
Add tests for #6608 | ||
|
||
fix https://github.com/paritytech/contract-issues/issues/12 | ||
crates: | ||
- name: pallet-revive-eth-rpc | ||
bump: minor | ||
- name: pallet-revive | ||
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
106 changes: 106 additions & 0 deletions
106
substrate/frame/revive/rpc/examples/js/abi/ErrorTester.json
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 @@ | ||
[ | ||
{ | ||
"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" | ||
} | ||
] |
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 ErrorTesterAbi = [ | ||
{ | ||
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; |
34 changes: 34 additions & 0 deletions
34
substrate/frame/revive/rpc/examples/js/abi/EventExample.json
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 @@ | ||
[ | ||
{ | ||
"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" | ||
} | ||
] |
34 changes: 34 additions & 0 deletions
34
substrate/frame/revive/rpc/examples/js/abi/EventExample.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,34 @@ | ||
export const EventExampleAbi = [ | ||
{ | ||
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; |
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,35 @@ | ||
[ | ||
{ | ||
"inputs": [], | ||
"name": "flip", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "getValue", | ||
"outputs": [ | ||
{ | ||
"internalType": "bool", | ||
"name": "", | ||
"type": "bool" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "value", | ||
"outputs": [ | ||
{ | ||
"internalType": "bool", | ||
"name": "", | ||
"type": "bool" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
} | ||
] |
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,35 @@ | ||
export const FlipperAbi = [ | ||
{ | ||
inputs: [], | ||
name: "flip", | ||
outputs: [], | ||
stateMutability: "nonpayable", | ||
type: "function", | ||
}, | ||
{ | ||
inputs: [], | ||
name: "getValue", | ||
outputs: [ | ||
{ | ||
internalType: "bool", | ||
name: "", | ||
type: "bool", | ||
}, | ||
], | ||
stateMutability: "view", | ||
type: "function", | ||
}, | ||
{ | ||
inputs: [], | ||
name: "value", | ||
outputs: [ | ||
{ | ||
internalType: "bool", | ||
name: "", | ||
type: "bool", | ||
}, | ||
], | ||
stateMutability: "view", | ||
type: "function", | ||
}, | ||
] as const; |
Oops, something went wrong.