Skip to content

Commit

Permalink
chore: ensures decoding of hex from rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
ckartik committed Dec 9, 2024
1 parent e6c15d6 commit 0457b85
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion p2p/pkg/rpc/provider/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,15 @@ func (s *Service) Stake(
}

for i, _ := range stake.BlsPublicKeys {
tx, txErr = s.registryContract.AddVerifiedBLSKey(opts, []byte(stake.BlsPublicKeys[i]), []byte(stake.BlsSignatures[i]))
pubKey, err := hex.DecodeString(stake.BlsPublicKeys[i])
if err != nil {
return nil, status.Errorf(codes.Internal, "decoding bls public key: %v", err)
}
signature, err := hex.DecodeString(stake.BlsSignatures[i])
if err != nil {
return nil, status.Errorf(codes.Internal, "decoding bls signature: %v", err)
}
tx, txErr = s.registryContract.AddVerifiedBLSKey(opts, pubKey, signature)
if txErr != nil {
return nil, status.Errorf(codes.Internal, "adding verified bls key: %v", txErr)
}
Expand Down

0 comments on commit 0457b85

Please sign in to comment.