Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/debug/getters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@
result:
name: EIP-2718 binary-encoded transaction
schema:
$ref: '#/components/schemas/bytes'
oneOf:
- $ref: '#/components/schemas/notFound'
- $ref: '#/components/schemas/bytes'
examples:
- name: debug_getRawTransaction example
params:
Expand Down
81 changes: 81 additions & 0 deletions src/eth/transaction.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,87 @@
v: '0xfe7'
r: '0x84caf09aefbd5e539295acc67217563438a4efb224879b6855f56857fa2037d3'
s: '0x5e863be3829812c81439f0ae9d8ecb832b531d651fb234c848d1bf45e62be8b9'
- name: eth_getRawTransactionByHash
summary: Returns the raw RLP-encoded transaction bytes requested by transaction hash.
params:
- name: Transaction hash
required: true
schema:
$ref: '#/components/schemas/hash32'
result:
name: Raw transaction
schema:
oneOf:
- $ref: '#/components/schemas/notFound'
- $ref: '#/components/schemas/bytes'
examples:
- name: eth_getRawTransactionByHash example
params:
- name: Transaction hash
value: '0xa52be92809541220ee0aaaede6047d9a6c5d0cd96a517c854d944ee70a0ebb44'
result:
name: Raw transaction
value: '0x02f86f010185012a05f20085012a05f2008252089400000000219ab540356cbb839cbe05303d7705fa8806f05b59d3b2000080c080a09a70c8a9f7255b4f5e36a4d14c5fd5c1f7da60ba7cda7a2aa7b6e5d5a41e5f0a07b2da7e3a8d15b2a61fb4e0e1a6f47c3b82d6e4f9c1a0b3e5d7c2f4a6b8d0e2'
- name: eth_getRawTransactionByBlockHashAndIndex
summary: Returns the raw RLP-encoded transaction bytes by block hash and transaction index position.
params:
- name: Block hash
required: true
schema:
$ref: '#/components/schemas/hash32'
- name: Transaction index
required: true
schema:
$ref: '#/components/schemas/uint'
result:
name: Raw transaction
schema:
oneOf:
- $ref: '#/components/schemas/notFound'
- $ref: '#/components/schemas/bytes'
errors:
- code: 4444
message: Pruned history unavailable
examples:
- name: eth_getRawTransactionByBlockHashAndIndex example
params:
- name: Block hash
value: '0xbf137c3a7a1ebdfac21252765e5d7f40d115c2757e4a4abee929be88c624fdb7'
- name: Transaction index
value: '0x2'
result:
name: Raw transaction
value: '0x02f86f010185012a05f20085012a05f2008252089400000000219ab540356cbb839cbe05303d7705fa8806f05b59d3b2000080c080a09a70c8a9f7255b4f5e36a4d14c5fd5c1f7da60ba7cda7a2aa7b6e5d5a41e5f0a07b2da7e3a8d15b2a61fb4e0e1a6f47c3b82d6e4f9c1a0b3e5d7c2f4a6b8d0e2'
- name: eth_getRawTransactionByBlockNumberAndIndex
summary: Returns the raw RLP-encoded transaction bytes by block number and transaction index position.
params:
- name: Block
required: true
schema:
$ref: '#/components/schemas/BlockNumberOrTag'
- name: Transaction index
required: true
schema:
$ref: '#/components/schemas/uint'
result:
name: Raw transaction
schema:
oneOf:
- $ref: '#/components/schemas/notFound'
- $ref: '#/components/schemas/bytes'
errors:
- code: 4444
message: Pruned history unavailable
examples:
- name: eth_getRawTransactionByBlockNumberAndIndex example
params:
- name: Block
value: '0x1442e'
- name: Transaction index
value: '0x2'
result:
name: Raw transaction
value: '0x02f86f010185012a05f20085012a05f2008252089400000000219ab540356cbb839cbe05303d7705fa8806f05b59d3b2000080c080a09a70c8a9f7255b4f5e36a4d14c5fd5c1f7da60ba7cda7a2aa7b6e5d5a41e5f0a07b2da7e3a8d15b2a61fb4e0e1a6f47c3b82d6e4f9c1a0b3e5d7c2f4a6b8d0e2'
- name: eth_getTransactionReceipt
summary: Returns the receipt of a transaction by transaction hash.
params:
Expand Down
3 changes: 3 additions & 0 deletions tests/debug_getRawTransaction/get-notfound-tx.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// gets a non-existent transaction
>> {"jsonrpc":"2.0","id":1,"method":"debug_getRawTransaction","params":["0x00000000000000000000000000000000000000000000000000000000deadbeef"]}
<< {"jsonrpc":"2.0","id":1,"result":null}
3 changes: 3 additions & 0 deletions tests/eth_getRawTransactionByBlockHashAndIndex/get-block-n.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// gets raw tx 0 in a non-empty block by block hash
>> {"jsonrpc":"2.0","id":1,"method":"eth_getRawTransactionByBlockHashAndIndex","params":["0x79ba0368c2c6563a7d263695b583dcc6d1c25d4988daa0105804d38bdd987f2f","0x0"]}
<< {"jsonrpc":"2.0","id":1,"result":"0xf889800183013a548080b83c600d380380600d6000396000f360004381526020014681526020014181526020014881526020014481526020013281526020013481526020016000f31ca0d642ba4d1f9388c5fd312bb9fb42d189a0b3c796de55093c85f30802a85147c8a037aa8680923f811a6988c03dd414ca00cd25d6876ba5925c7ca8ac6aad21669d"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// gets raw tx with index exceeding block transaction count
>> {"jsonrpc":"2.0","id":1,"method":"eth_getRawTransactionByBlockHashAndIndex","params":["0x79ba0368c2c6563a7d263695b583dcc6d1c25d4988daa0105804d38bdd987f2f","0x4"]}
<< {"jsonrpc":"2.0","id":1,"result":null}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// gets raw tx from a non-existent block hash
>> {"jsonrpc":"2.0","id":1,"method":"eth_getRawTransactionByBlockHashAndIndex","params":["0x00000000000000000000000000000000000000000000000000000000deadbeef","0x0"]}
<< {"jsonrpc":"2.0","id":1,"result":null}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// gets raw tx 0 in a non-empty block by block number
>> {"jsonrpc":"2.0","id":1,"method":"eth_getRawTransactionByBlockNumberAndIndex","params":["0x1","0x0"]}
<< {"jsonrpc":"2.0","id":1,"result":"0xf889800183013a548080b83c600d380380600d6000396000f360004381526020014681526020014181526020014881526020014481526020013281526020013481526020016000f31ca0d642ba4d1f9388c5fd312bb9fb42d189a0b3c796de55093c85f30802a85147c8a037aa8680923f811a6988c03dd414ca00cd25d6876ba5925c7ca8ac6aad21669d"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// gets raw tx with index exceeding block transaction count
>> {"jsonrpc":"2.0","id":1,"method":"eth_getRawTransactionByBlockNumberAndIndex","params":["0x1","0x4"]}
<< {"jsonrpc":"2.0","id":1,"result":null}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// gets raw tx from a non-existent block number
>> {"jsonrpc":"2.0","id":1,"method":"eth_getRawTransactionByBlockNumberAndIndex","params":["0x5f5e0ff","0x0"]}
<< {"jsonrpc":"2.0","id":1,"result":null}
3 changes: 3 additions & 0 deletions tests/eth_getRawTransactionByHash/get-empty-tx.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// requests the zero transaction hash
>> {"jsonrpc":"2.0","id":1,"method":"eth_getRawTransactionByHash","params":["0x0000000000000000000000000000000000000000000000000000000000000000"]}
<< {"jsonrpc":"2.0","id":1,"result":null}
3 changes: 3 additions & 0 deletions tests/eth_getRawTransactionByHash/get-legacy-tx.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// gets the RLP-encoded bytes of a legacy transaction
>> {"jsonrpc":"2.0","id":1,"method":"eth_getRawTransactionByHash","params":["0x0d6999c0e9e4bec347945593e97bdcdf7c25be08ca1a1efdc520dbe75be985f3"]}
<< {"jsonrpc":"2.0","id":1,"result":"0xf85f070182520894eda8645ba6948855e3b3cd596bbb07596d59c60301801ba0fad01b9a15db73d59b0a74b3d85718dfebb7cde80f916840a006ef5f2a85769ea060b08e6b12604d91c6e2c514f2c020562b61f97973ada18a1701937d3302e5f3"}
3 changes: 3 additions & 0 deletions tests/eth_getRawTransactionByHash/get-notfound-tx.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// gets a non-existent transaction
>> {"jsonrpc":"2.0","id":1,"method":"eth_getRawTransactionByHash","params":["0x00000000000000000000000000000000000000000000000000000000deadbeef"]}
<< {"jsonrpc":"2.0","id":1,"result":null}
16 changes: 12 additions & 4 deletions tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,26 @@ require (
)

require (
github.com/DataDog/zstd v1.5.2 // indirect
github.com/DataDog/zstd v1.5.7 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6 // indirect
github.com/RaduBerinde/axisds v0.1.0 // indirect
github.com/RaduBerinde/btreemap v0.0.0-20250419174037-3d62b7205d54 // indirect
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/VictoriaMetrics/fastcache v1.13.0 // indirect
github.com/alexflint/go-scalar v1.1.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.20.0 // indirect
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cockroachdb/crlib v0.0.0-20241112164430-1264a2edc35b // indirect
github.com/cockroachdb/errors v1.11.3 // indirect
github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v1.1.5 // indirect
github.com/cockroachdb/pebble/v2 v2.1.4 // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/swiss v0.0.0-20251224182025-b0f6560f979b // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/consensys/gnark-crypto v0.18.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect
Expand Down Expand Up @@ -79,14 +84,15 @@ require (
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/kilic/bls12-381 v0.1.0 // indirect
github.com/klauspost/compress v1.17.8 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/minio/minlz v1.0.1-0.20250507153514-87eb42fe8882 // indirect
github.com/minio/sha256-simd v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/mitchellh/pointerstructure v1.2.0 // indirect
Expand All @@ -100,10 +106,10 @@ require (
github.com/pion/stun/v3 v3.1.2 // indirect
github.com/pion/transport/v4 v4.0.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.15.0 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/protolambda/bls12-381-util v0.1.0 // indirect
github.com/protolambda/zrnt v0.34.1 // indirect
github.com/protolambda/ztyp v0.2.2 // indirect
Expand Down Expand Up @@ -148,3 +154,5 @@ require (
)

tool github.com/open-rpc/openrpc-linter

replace github.com/ethereum/go-ethereum => github.com/manusw7/go-ethereum v1.17.4-0.20260626133832-33e1d84d16d0
Loading