eth_call with blobs - added more spec tests (#6687)

* added more spec tests

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

* fixed typo

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

* fixed error message

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

---------

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
pull/6676/head
Sally MacFarlane 9 months ago committed by GitHub
parent 8becd5a3a8
commit 246cce41e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 22
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_call_blob_without_to.json
  2. 23
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_call_blob_zero_versioned_hash.json
  3. 2
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionValidator.java

@ -0,0 +1,22 @@
{
"request": {
"id": 4,
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"from": "a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"data": "0x12a7b914",
"blobVersionedHashes" : ["0x0100000051c8833cfbaf272e62da1285b183b0405357f62b052a4894ffcdaa2d"],
"maxFeePerBlobGas": "0x3b9aca00"
},
"latest"
]
},
"response": {
"jsonrpc": "2.0",
"id": 4,
"error":{"code":-32602,"message":"Invalid transaction type"}
},
"statusCode": 200
}

@ -0,0 +1,23 @@
{
"request": {
"id": 4,
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"to": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"from": "a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"data": "0x12a7b914",
"blobVersionedHashes" : ["0x0"],
"maxFeePerBlobGas": "0x3b9aca00"
},
"latest"
]
},
"response": {
"jsonrpc": "2.0",
"id": 4,
"error":{"code":-32602,"message":"Invalid params"}
},
"statusCode": 200
}

@ -304,7 +304,7 @@ public class MainnetTransactionValidator implements TransactionValidator {
if (transaction.getType().supportsBlob() && transaction.getTo().isEmpty()) {
return ValidationResult.invalid(
TransactionInvalidReason.INVALID_TRANSACTION_FORMAT,
"transaction blob transactions cannot have a to address");
"transaction blob transactions must have a to address");
}
if (transaction.getVersionedHashes().isEmpty()) {

Loading…
Cancel
Save