parent
f5b9c7e7e6
commit
4efc1bfcfa
@ -0,0 +1,14 @@ |
||||
package client |
||||
|
||||
import ( |
||||
"harmony-benchmark/blockchain" |
||||
) |
||||
|
||||
// A client represent a entity/user which send transactions and receive responses from the harmony network
|
||||
type Client struct { |
||||
pendingCrossTxs map[[32]byte]*blockchain.Transaction // map of TxId to pending cross shard txs
|
||||
} |
||||
|
||||
func (client *Client) TransactionMessageHandler(msgPayload []byte) { |
||||
// TODO: Implement this
|
||||
} |
@ -0,0 +1,29 @@ |
||||
package client |
||||
|
||||
import ( |
||||
"bytes" |
||||
"harmony-benchmark/common" |
||||
) |
||||
|
||||
// The specific types of message under CLIENT category
|
||||
type ClientMessageType byte |
||||
|
||||
const ( |
||||
TRANSACTION ClientMessageType = iota |
||||
// TODO: add more types
|
||||
) |
||||
|
||||
// The types of messages used for CLIENT/TRANSACTION
|
||||
type TransactionMessageType int |
||||
|
||||
const ( |
||||
CROSS_TX TransactionMessageType = iota // The proof of accept or reject returned by the leader to the cross shard transaction client.
|
||||
) |
||||
|
||||
//ConstructStopMessage is STOP message
|
||||
func ConstructProofOfAcceptOrRejectMessage() []byte { |
||||
byteBuffer := bytes.NewBuffer([]byte{byte(common.CLIENT)}) |
||||
byteBuffer.WriteByte(byte(TRANSACTION)) |
||||
byteBuffer.WriteByte(byte(CROSS_TX)) |
||||
return byteBuffer.Bytes() |
||||
} |
Loading…
Reference in new issue