Skip to content

rvgo: Witness cmd saves witness & stateHash to json#36

Merged
pcw109550 merged 1 commit intomasterfrom
tip/pcw109550/expose-witness
Apr 10, 2024
Merged

rvgo: Witness cmd saves witness & stateHash to json#36
pcw109550 merged 1 commit intomasterfrom
tip/pcw109550/expose-witness

Conversation

@pcw109550
Copy link
Copy Markdown
Member

@pcw109550 pcw109550 commented Apr 8, 2024

Description

Make witness command save witness and statehash to json.

type WitnessOutput struct {
	Witness   []byte   `json:"witness"`
	StateHash [32]byte `json:"stateHash"`
}

Tests

Manually tested using the absolute prestate of op-program on riscv.

Command: ./asterisc witness --input prestate.json --output -
Output:

{
  "witness": "wOSi8Cm62dDmKt1OGwxlLrSznk6zE4ghp7evP1rfrXYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIGCAAAAAAAAAAAAAAAAB/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
  "stateHash": [
    3,
    33,
    111,
    220,
    74,
    123,
    253,
    76,
    113,
    96,
    250,
    148,
    109,
    27,
    254,
    69,
    29,
    19,
    255,
    50,
    218,
    73,
    102,
    9,
    254,
    24,
    53,
    82,
    130,
    185,
    16,
    198
  ]
}

@pcw109550 pcw109550 requested a review from ImTei April 9, 2024 21:42
@pcw109550 pcw109550 marked this pull request as ready for review April 9, 2024 21:42
@pcw109550 pcw109550 added this pull request to the merge queue Apr 10, 2024
Merged via the queue into master with commit 332fe52 Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants