bitxhub/internal/model/model.go

30 lines
557 B
Go
Raw Normal View History

2020-03-29 21:32:01 +08:00
package model
import "encoding/json"
type MerkleWrapperSign struct {
Address string `json:"address"`
Signature []byte `json:"signature"`
}
func (m *MerkleWrapperSign) Marshal() ([]byte, error) {
return json.Marshal(m)
}
func (m *MerkleWrapperSign) Unmarshal(data []byte) error {
return json.Unmarshal(data, m)
}
type CertsMessage struct {
AgencyCert []byte
NodeCert []byte
}
func (c *CertsMessage) Marshal() ([]byte, error) {
return json.Marshal(c)
}
func (c *CertsMessage) Unmarshal(data []byte) error {
return json.Unmarshal(data, c)
}