mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-21 08:51:32 +00:00
First tests of go-data encoding
This commit is contained in:
@ -91,7 +91,7 @@ func (p *SignatureEd25519) UnmarshalJSON(enc []byte) error {
|
||||
//-------------------------------------
|
||||
|
||||
// Implements Signature
|
||||
type SignatureSecp256k1 data.Bytes
|
||||
type SignatureSecp256k1 []byte
|
||||
|
||||
func (sig SignatureSecp256k1) Bytes() []byte {
|
||||
return wire.BinaryBytes(struct{ Signature }{sig})
|
||||
@ -108,3 +108,10 @@ func (sig SignatureSecp256k1) Equals(other Signature) bool {
|
||||
return false
|
||||
}
|
||||
}
|
||||
func (p SignatureSecp256k1) MarshalJSON() ([]byte, error) {
|
||||
return data.Encoder.Marshal(p)
|
||||
}
|
||||
|
||||
func (p *SignatureSecp256k1) UnmarshalJSON(enc []byte) error {
|
||||
return data.Encoder.Unmarshal((*[]byte)(p), enc)
|
||||
}
|
||||
|
Reference in New Issue
Block a user