Skip to content

Commit 638acc3

Browse files
fix t8ntool rq output
1 parent 3eafb13 commit 638acc3

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

packages/vm/test/t8n/t8ntool.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import type { Block } from '@ethereumjs/block'
2525
import type { Common } from '@ethereumjs/common'
2626
import type { Log } from '@ethereumjs/evm'
2727
import type { TypedTxData } from '@ethereumjs/tx'
28-
import type { PrefixedHexString } from '@ethereumjs/util'
28+
import type { CLRequest, CLRequestType, PrefixedHexString } from '@ethereumjs/util'
2929
const kzg = new microEthKZG(trustedSetup)
3030

3131
/**
@@ -118,7 +118,7 @@ export class TransitionTool {
118118

119119
const result = await builder.build()
120120

121-
const convertedOutput = this.getOutput(result)
121+
const convertedOutput = this.getOutput(result.block, result.requests)
122122
const alloc = await this.stateTracker.dumpAlloc()
123123

124124
this.writeOutput(args, convertedOutput, alloc)
@@ -195,7 +195,7 @@ export class TransitionTool {
195195
})
196196
}
197197

198-
private getOutput(block: Block): T8NOutput {
198+
private getOutput(block: Block, requests?: CLRequest<CLRequestType>[]): T8NOutput {
199199
const output: T8NOutput = {
200200
stateRoot: bytesToHex(block.header.stateRoot),
201201
txRoot: bytesToHex(block.header.transactionsTrie),
@@ -226,8 +226,9 @@ export class TransitionTool {
226226
output.requestsHash = bytesToHex(block.header.requestsRoot)
227227
}
228228

229-
if (block.requests !== undefined) {
230-
output.requests = block.requests.map((request) => request.toJSON())
229+
if (requests !== undefined) {
230+
// NOTE: EEST currently wants the raw request bytes, **excluding** the type
231+
output.requests = requests.map((request) => bytesToHex(request.bytes.slice(1)))
231232
}
232233

233234
if (this.rejected.length > 0) {

packages/vm/test/t8n/types.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import type { CLRequestType, RequestJSON } from '@ethereumjs/util'
2-
31
export type T8NOptions = {
42
state: {
53
fork: string
@@ -70,7 +68,7 @@ export type T8NOutput = {
7068
blobGasUsed?: string
7169
currentExcessBlobGas?: string
7270
requestsHash?: string
73-
requests?: RequestJSON[CLRequestType][]
71+
requests?: string[]
7472
rejected?: T8NRejectedTx[]
7573
}
7674

0 commit comments

Comments
 (0)