Skip to content

Commit

Permalink
add documentation for consensus message submit transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
QuestofIranon committed Feb 20, 2020
1 parent 1d5d879 commit bc7466c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions consensus_message_submit_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ type ConsensusMessageSubmitTransaction struct {
pb *proto.ConsensusSubmitMessageTransactionBody
}

// NewConsensusMessageSubmitTransaction creates a ConsensusMessageSubmitTransaction builder which can be used to
// construct and execute a Consensus Submit Message Transaction.
func NewConsensusMessageSubmitTransaction() ConsensusMessageSubmitTransaction {
pb := &proto.ConsensusSubmitMessageTransactionBody{}

Expand All @@ -22,20 +24,18 @@ func NewConsensusMessageSubmitTransaction() ConsensusMessageSubmitTransaction {
return builder
}

// SetTopic sets the topic to submit the message to.
func (builder ConsensusMessageSubmitTransaction) SetTopicID(id ConsensusTopicID) ConsensusMessageSubmitTransaction {
builder.pb.TopicID = id.toProto()
return builder
}

// SetMessage sets the message to be submitted. Max size of the Transaction (including signatures) is 4kB.
func (builder ConsensusMessageSubmitTransaction) SetMessage(message []byte) ConsensusMessageSubmitTransaction {
builder.pb.Message = message
return builder
}

func (builder ConsensusMessageSubmitTransaction) Build(client *Client) (Transaction, error) {
return builder.TransactionBuilder.Build(client)
}

//
// The following _5_ must be copy-pasted at the bottom of **every** _transaction.go file
// We override the embedded fluent setter methods to return the outer type
Expand Down

0 comments on commit bc7466c

Please sign in to comment.