Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidu28 committed Feb 28, 2024
1 parent 39e0f61 commit 1a56334
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions merkle_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ func setupSuite() {
fmt.Println("error in NewEigenPodProofs", err)
}

beacon.ComputeBeaconStateTopLevelRootsDeneb(&oracleState)

executionPayloadFieldRoots, _ = beacon.ComputeExecutionPayloadFieldRootsDeneb(block.Body.ExecutionPayload)
}

Expand Down Expand Up @@ -361,6 +363,26 @@ func TestGenerateWithdrawalCredentialsProof(t *testing.T) {
assert.True(t, flag, "Proof %v failed")
}

func TestGenerateWithdrawalCredentialsProofUsingCache(t *testing.T) {

// picking up one random validator index
validatorIndex := phase0.ValidatorIndex(REPOINTED_VALIDATOR_INDEX)

beaconStateTopLevelRoots, err := beacon.ComputeBeaconStateTopLevelRootsDeneb(&oracleState)
if err != nil {
fmt.Println("error reading beaconStateTopLevelRoots")
}

proof, err := epp.ProveValidatorAgainstBeaconState(beaconStateTopLevelRoots, oracleState.Slot, oracleState.Validators, uint64(validatorIndex))
if err != nil {
fmt.Println(err)
}

flag := verifyValidatorAgainstBeaconState(&oracleState, proof, uint64(validatorIndex))

assert.True(t, flag, "Proof %v failed")
}

func TestCreateVersionedSignedBlockDeneb(t *testing.T) {
block := deneb.BeaconBlock{}
versionedBlock, err := beacon.CreateVersionedSignedBlock(block)
Expand Down

0 comments on commit 1a56334

Please sign in to comment.