Skip to content

Commit

Permalink
Add geth-diff-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pgherveou committed Nov 22, 2024
1 parent 7c5224c commit 1f069da
Show file tree
Hide file tree
Showing 22 changed files with 1,148 additions and 255 deletions.
106 changes: 106 additions & 0 deletions substrate/frame/revive/rpc/examples/js/abi/errorTester.json
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 substrate/frame/revive/rpc/examples/js/abi/errorTester.ts
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;
66 changes: 33 additions & 33 deletions substrate/frame/revive/rpc/examples/js/abi/event.json
Original file line number Diff line number Diff line change
@@ -1,34 +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"
}
]
{
"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 substrate/frame/revive/rpc/examples/js/abi/event.ts
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;
Loading

0 comments on commit 1f069da

Please sign in to comment.