Skip to content

Commit

Permalink
Convert update to szz encoded uint16 array
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetrun5 committed Dec 1, 2023
1 parent 7673880 commit 1bde7fd
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion chains/evm/prover/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,22 @@ func (p *Prover) RotateProof(epoch uint64) (*EvmProof[message.RotateInput], erro
return nil, err
}

type rotateArgs struct {
Update []uint16 `json:"light_client_update"`
Spec Spec `json:"spec"`
}
updateSzz, _ := args.Update.MarshalSSZ()

updateArray := make([]uint16, len(updateSzz))
for i, value := range updateSzz {
updateArray[i] = uint16(value)
}
rArgs := rotateArgs{
Update: updateArray,
Spec: args.Spec,
}
var resp ProverResponse
err = p.proverClient.CallFor(context.Background(), &resp, "genEvmProofAndInstancesRotationCircuitWithWitness", args)
err = p.proverClient.CallFor(context.Background(), &resp, "genEvmProofAndInstancesRotationCircuitWithWitness", rArgs)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 1bde7fd

Please sign in to comment.