Skip to content

Commit

Permalink
icon validators hash in bmr config + bsr in ixh.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
bbist committed Jun 14, 2022
1 parent aea0188 commit 4f95bbe
Show file tree
Hide file tree
Showing 5 changed files with 379 additions and 187 deletions.
8 changes: 1 addition & 7 deletions cmd/btpsimple/chain/icon/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package icon

import (
"context"
"encoding/base64"
"encoding/json"
"fmt"
"io"
Expand Down Expand Up @@ -129,12 +128,7 @@ func (r *receiver) receiveLoop(

var err error

// For the base63 encoding of previous header's NextValidatorHash
// fetch list of validator addresses and populate cache
vHash, err := base64.StdEncoding.DecodeString(r.opts.Verifier.ValidatorHash)
if err != nil {
return errors.Wrap(err, "receiveLoop; Base64Decode ValidatorHash; Err: ")
}
vHash := r.opts.Verifier.ValidatorsHash
vBytes, err := r.cl.GetDataByHash(&DataHashParam{Hash: NewHexBytes(vHash)})
if err != nil {
return errors.Wrap(err, "receiveLoop; GetDataByHash Validators; Err: ")
Expand Down
4 changes: 2 additions & 2 deletions cmd/btpsimple/chain/icon/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
)

type VerifierOptions struct {
BlockHeight uint64 `json:"blockHeight"`
ValidatorHash string `json:"validatorHash"`
BlockHeight uint64 `json:"blockHeight"`
ValidatorsHash common.HexBytes `json:"validatorsHash"`
}

type commitVoteItem struct {
Expand Down
Loading

0 comments on commit 4f95bbe

Please sign in to comment.