Browse Source

fix RPC blockresults return (#5459) (#5463)

pull/5476/head
Marko 4 years ago
committed by GitHub
parent
commit
dac18d73a7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions
  1. +1
    -1
      CHANGELOG_PENDING.md
  2. +6
    -0
      crypto/encoding/codec.go

+ 1
- 1
CHANGELOG_PENDING.md View File

@ -29,4 +29,4 @@ Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermi
### BUG FIXES ### BUG FIXES
- [privval] \#5441 Fix faulty ping message encoding causing nil message errors in logs (@erikgrinaker) - [privval] \#5441 Fix faulty ping message encoding causing nil message errors in logs (@erikgrinaker)
- [rpc] \#5459 Register the interface of public keys for json encoding (@marbar3778)

+ 6
- 0
crypto/encoding/codec.go View File

@ -5,9 +5,15 @@ import (
"github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/crypto/ed25519" "github.com/tendermint/tendermint/crypto/ed25519"
"github.com/tendermint/tendermint/libs/json"
pc "github.com/tendermint/tendermint/proto/tendermint/crypto" pc "github.com/tendermint/tendermint/proto/tendermint/crypto"
) )
func init() {
json.RegisterType((*pc.PublicKey)(nil), "tendermint.crypto.PublicKey")
json.RegisterType((*pc.PublicKey_Ed25519)(nil), "tendermint.crypto.PublicKey_Ed25519")
}
// PubKeyToProto takes crypto.PubKey and transforms it to a protobuf Pubkey // PubKeyToProto takes crypto.PubKey and transforms it to a protobuf Pubkey
func PubKeyToProto(k crypto.PubKey) (pc.PublicKey, error) { func PubKeyToProto(k crypto.PubKey) (pc.PublicKey, error) {
var kp pc.PublicKey var kp pc.PublicKey


Loading…
Cancel
Save