Skip to content

write timestamp to the input #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 12, 2024
Merged
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
2 changes: 2 additions & 0 deletions src/dsp/ethereum/blockprep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export class AccountPrep {
export class BlockPrep {
rlpheader: string
number: any
timestamp: any
// rlpHeader: any
hash: string
stateRoot: string
Expand All @@ -89,6 +90,7 @@ export class BlockPrep {
// constructor(blocknum: number | bigint | BytesLike | Hexable, hash: string, stateRoot: string, receiptsRoot: string, transactionsRoot: string) {
constructor(rawblock: Record<string, string>) {
this.number = parseInt(rawblock.number, 16)
this.timestamp = parseInt(rawblock.timestamp, 16)
this.hash = rawblock.hash
this.stateRoot = rawblock.stateRoot
this.receiptsRoot = rawblock.receiptsRoot
Expand Down
2 changes: 2 additions & 0 deletions src/dsp/ethereum/fill_blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ export function setFillInputTxsFunc(_func: any) {
export function fillInputOneBlock(input: any, cleYaml: CLEYaml, blockPrep: BlockPrep) {
input.addInt(blockPrep.number, 0)

// add timestamp
input.addInt(blockPrep.timestamp, 0)
// TODO: adjust this with lib
// input.addVarLenHexString(
// // blockPrep?.rlpHeader,
Expand Down