github.com/annchain/OG@v0.0.9/message/general_message.go (about)

     1  package message
     2  
     3  import (
     4  	"github.com/annchain/OG/common"
     5  	"github.com/annchain/OG/common/crypto"
     6  	"github.com/annchain/OG/common/hexutil"
     7  )
     8  
     9  type GeneralMessageType byte
    10  
    11  type GeneralMessage interface {
    12  	GetType() GeneralMessageType
    13  	GetBytes() []byte
    14  	String() string
    15  }
    16  
    17  type GeneralPeer struct {
    18  	Id             int
    19  	PublicKey      crypto.PublicKey `json:"-"`
    20  	Address        common.Address   `json:"address"`
    21  	PublicKeyBytes hexutil.Bytes    `json:"public_key"`
    22  }
    23  
    24  type GeneralMessageEvent struct {
    25  	Message GeneralMessage
    26  	Sender  GeneralPeer
    27  }