-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
William Cory
authored and
William Cory
committed
Jul 2, 2024
1 parent
3305140
commit 858dd04
Showing
31 changed files
with
1,062 additions
and
536 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
53 changes: 53 additions & 0 deletions
53
packages/procedures/src/call/__snapshots__/callProcedure.spec.ts.snap
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,53 @@ | ||
// Bun Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`callProcedure should handle a basic call 1`] = ` | ||
{ | ||
"amountSpent": "0x296a6", | ||
"createdAddresses": [], | ||
"executionGasUsed": "0xc62", | ||
"gas": "0x1c964d6", | ||
"logs": [], | ||
"rawData": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000", | ||
"selfdestruct": [], | ||
"totalGasSpent": "0x5eaa", | ||
} | ||
`; | ||
|
||
exports[`callProcedure should handle a call with state override 1`] = ` | ||
{ | ||
"amountSpent": "0x23e38", | ||
"executionGasUsed": "0x0", | ||
"rawData": "0x", | ||
"totalGasSpent": "0x5208", | ||
} | ||
`; | ||
|
||
exports[`callProcedure should handle errors from callHandler 1`] = ` | ||
{ | ||
"code": -32000, | ||
"data": { | ||
"errors": [ | ||
"sender doesn't have enough funds to send tx. The upfront cost is: 210000500 and the sender's account (0x4242424242424242424242424242424242424242) only has: 0 -> block number=0 hash=0x63b5bacdb65c8c9d10e77d77d40bda5b4dc010a4f7e02a10bdea21a2b1b0a454 hf=cancun baseFeePerGas=7 txs=0 uncles=0 -> tx type=2 hash=0x66575cf759d7c97e42f103bfc8de6f88f70ea97a785d0c1f558496abf977cae1 nonce=0 value=500 signed=true hf=cancun maxFeePerGas=7 maxPriorityFeePerGas=0) | ||
Docs: https://tevm.sh/reference/tevm/errors/classes/insufficientfundserror/ | ||
Version: 1.1.0.next-73 | ||
Docs: https://tevm.sh/reference/tevm/errors/classes/insufficientfundserror/ | ||
Details: /reference/tevm/errors/classes/insufficientfundserror/ | ||
Version: 1.1.0.next-73" | ||
, | ||
], | ||
}, | ||
"message": | ||
"sender doesn't have enough funds to send tx. The upfront cost is: 210000500 and the sender's account (0x4242424242424242424242424242424242424242) only has: 0 -> block number=0 hash=0x63b5bacdb65c8c9d10e77d77d40bda5b4dc010a4f7e02a10bdea21a2b1b0a454 hf=cancun baseFeePerGas=7 txs=0 uncles=0 -> tx type=2 hash=0x66575cf759d7c97e42f103bfc8de6f88f70ea97a785d0c1f558496abf977cae1 nonce=0 value=500 signed=true hf=cancun maxFeePerGas=7 maxPriorityFeePerGas=0) | ||
Docs: https://tevm.sh/reference/tevm/errors/classes/insufficientfundserror/ | ||
Version: 1.1.0.next-73 | ||
Docs: https://tevm.sh/reference/tevm/errors/classes/insufficientfundserror/ | ||
Details: /reference/tevm/errors/classes/insufficientfundserror/ | ||
Version: 1.1.0.next-73" | ||
, | ||
} | ||
`; |
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
124 changes: 124 additions & 0 deletions
124
packages/procedures/src/eth/__snapshots__/ethGetBlockByHashProcedure.spec.ts.snap
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,124 @@ | ||
// Bun Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ethGetBlockByHashJsonRpcProcedure should return block details by hash 1`] = ` | ||
{ | ||
"baseFeePerGas": "0x7", | ||
"blobGasUsed": "0x0", | ||
"difficulty": "0x0", | ||
"excessBlobGas": "0x0", | ||
"extraData": "0x", | ||
"gasLimit": "0x1c9c380", | ||
"gasUsed": "0x5208", | ||
"hash": "0xd5c6fb8547f642937fac28ed08bac378b24fa000017029cf7e52996e2af217d6", | ||
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", | ||
"miner": "0x0000000000000000000000000000000000000000", | ||
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", | ||
"nonce": "0x0000000000000000", | ||
"number": "0x1", | ||
"parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", | ||
"parentHash": "0x63b5bacdb65c8c9d10e77d77d40bda5b4dc010a4f7e02a10bdea21a2b1b0a454", | ||
"receiptsRoot": "0xf78dfb743fbd92ade140711c8bbc542b5e307f0ab7984eff35d751969fe57efa", | ||
"requests": undefined, | ||
"requestsRoot": undefined, | ||
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", | ||
"size": "0x6d1", | ||
"stateRoot": "0xd417e9ddb1cd7255747c7a5ea9b703fea4851b04aa2917ca5d4e8b12ec0efe0f", | ||
"timestamp": "0x6683628e", | ||
"totalDifficulty": "0x0", | ||
"transactions": [ | ||
"0x53f34b8aec96f115c92c8e49f3ec2abe1cb606d59e07732e3be76408628991f5", | ||
], | ||
"transactionsRoot": "0x728f001e8385a75fdb87571fa02a8ac4ec71211f4e292e48d11c2aa36a7aca29", | ||
"uncles": [], | ||
"withdrawals": [], | ||
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", | ||
} | ||
`; | ||
|
||
exports[`ethGetBlockByHashJsonRpcProcedure should include transactions if requested 1`] = ` | ||
{ | ||
"baseFeePerGas": "0x7", | ||
"blobGasUsed": "0x0", | ||
"difficulty": "0x0", | ||
"excessBlobGas": "0x0", | ||
"extraData": "0x", | ||
"gasLimit": "0x1c9c380", | ||
"gasUsed": "0x5208", | ||
"hash": "0xd5c6fb8547f642937fac28ed08bac378b24fa000017029cf7e52996e2af217d6", | ||
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", | ||
"miner": "0x0000000000000000000000000000000000000000", | ||
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", | ||
"nonce": "0x0000000000000000", | ||
"number": "0x1", | ||
"parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", | ||
"parentHash": "0x63b5bacdb65c8c9d10e77d77d40bda5b4dc010a4f7e02a10bdea21a2b1b0a454", | ||
"receiptsRoot": "0xf78dfb743fbd92ade140711c8bbc542b5e307f0ab7984eff35d751969fe57efa", | ||
"requests": undefined, | ||
"requestsRoot": undefined, | ||
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", | ||
"size": "0x6d1", | ||
"stateRoot": "0xd417e9ddb1cd7255747c7a5ea9b703fea4851b04aa2917ca5d4e8b12ec0efe0f", | ||
"timestamp": "0x6683628e", | ||
"totalDifficulty": "0x0", | ||
"transactions": [ | ||
{ | ||
"accessList": [], | ||
"blobVersionedHashes": undefined, | ||
"blockHash": "0xd5c6fb8547f642937fac28ed08bac378b24fa000017029cf7e52996e2af217d6", | ||
"blockNumber": "0x1", | ||
"data": "0x", | ||
"from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", | ||
"gas": "0x5a3c", | ||
"gasPrice": "0x7", | ||
"hash": "0x53f34b8aec96f115c92c8e49f3ec2abe1cb606d59e07732e3be76408628991f5", | ||
"maxFeePerBlobGas": undefined, | ||
"maxFeePerGas": "0x7", | ||
"maxPriorityFeePerGas": "0x0", | ||
"nonce": "0x0", | ||
"to": "0x0101010101010101010101010101010101010101", | ||
"transactionIndex": "0x0", | ||
"type": "0x2", | ||
"value": "0x1a4", | ||
}, | ||
], | ||
"transactionsRoot": "0x728f001e8385a75fdb87571fa02a8ac4ec71211f4e292e48d11c2aa36a7aca29", | ||
"uncles": [], | ||
"withdrawals": [], | ||
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", | ||
} | ||
`; | ||
|
||
exports[`ethGetBlockByHashJsonRpcProcedure should handle requests without an id 1`] = ` | ||
{ | ||
"baseFeePerGas": "0x7", | ||
"blobGasUsed": "0x0", | ||
"difficulty": "0x0", | ||
"excessBlobGas": "0x0", | ||
"extraData": "0x", | ||
"gasLimit": "0x1c9c380", | ||
"gasUsed": "0x5208", | ||
"hash": "0xd5c6fb8547f642937fac28ed08bac378b24fa000017029cf7e52996e2af217d6", | ||
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", | ||
"miner": "0x0000000000000000000000000000000000000000", | ||
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", | ||
"nonce": "0x0000000000000000", | ||
"number": "0x1", | ||
"parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", | ||
"parentHash": "0x63b5bacdb65c8c9d10e77d77d40bda5b4dc010a4f7e02a10bdea21a2b1b0a454", | ||
"receiptsRoot": "0xf78dfb743fbd92ade140711c8bbc542b5e307f0ab7984eff35d751969fe57efa", | ||
"requests": undefined, | ||
"requestsRoot": undefined, | ||
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", | ||
"size": "0x6d1", | ||
"stateRoot": "0xd417e9ddb1cd7255747c7a5ea9b703fea4851b04aa2917ca5d4e8b12ec0efe0f", | ||
"timestamp": "0x6683628e", | ||
"totalDifficulty": "0x0", | ||
"transactions": [ | ||
"0x53f34b8aec96f115c92c8e49f3ec2abe1cb606d59e07732e3be76408628991f5", | ||
], | ||
"transactionsRoot": "0x728f001e8385a75fdb87571fa02a8ac4ec71211f4e292e48d11c2aa36a7aca29", | ||
"uncles": [], | ||
"withdrawals": [], | ||
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", | ||
} | ||
`; |
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
5 changes: 5 additions & 0 deletions
5
.../procedures/src/eth/__snapshots__/ethGetBlockTransactionCountByHashProcedure.spec.ts.snap
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,5 @@ | ||
// Bun Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ethGetBlockTransactionCountByHashJsonRpcProcedure should handle an invalid block hash 1`] = `[BaseError: Invalid byte sequence ("0I" in "0InvalidHash"). | ||
Version: [email protected]]`; |
40 changes: 40 additions & 0 deletions
40
packages/procedures/src/eth/__snapshots__/ethGetFilterChangesProcedure.spec.ts.snap
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,40 @@ | ||
// Bun Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ethGetFilterChangesProcedure should return log changes for Log type filter 1`] = ` | ||
[ | ||
{ | ||
"address": "0x0000000000000000000000000000000000000000", | ||
"blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000", | ||
"blockNumber": "0x1", | ||
"data": "0x0000000000000000000000000000000000000000000000000000000000000000", | ||
"logIndex": "0x0", | ||
"removed": false, | ||
"topics": [ | ||
"0x0000000000000000000000000000000000000000000000000000000000000000", | ||
], | ||
"transactionHash": "0x0000000000000000000000000000000000000000000000000000000000000000", | ||
"transactionIndex": "0x0", | ||
}, | ||
] | ||
`; | ||
|
||
exports[`ethGetFilterChangesProcedure should return block changes for Block type filter 1`] = ` | ||
[ | ||
"0x1", | ||
] | ||
`; | ||
|
||
exports[`ethGetFilterChangesProcedure should return an error if the filter is not found 1`] = ` | ||
{ | ||
"code": -32601, | ||
"message": "Method not implemented yet", | ||
} | ||
`; | ||
|
||
exports[`ethGetFilterChangesProcedure should throw an error for an unknown filter type 1`] = `[Error: InternalError: Unknown filter type. This indicates a bug in tevm or potentially a typo in filter type if manually added]`; | ||
|
||
exports[`ethGetFilterChangesProcedure should return transaction changes for PendingTransaction type filter 1`] = ` | ||
[ | ||
"0x9451a27a810f49a49f917da5e6ad3ecc7182e31b0d71560e9bf4af4928ac52fc", | ||
] | ||
`; |
Oops, something went wrong.