Skip to content

Commit

Permalink
fix: CBOR encoding for TxSubmission MsgRequestTxs
Browse files Browse the repository at this point in the history
  • Loading branch information
agaffney committed Dec 10, 2023
1 parent 84a7e14 commit 37ebcb2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions protocol/txsubmission/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,20 @@ type MsgRequestTxs struct {
TxIds []TxId
}

func (m *MsgRequestTxs) MarshalCBOR() ([]byte, error) {
items := []any{}
for _, txId := range m.TxIds {
items = append(items, txId)
}
tmp := []any{
MessageTypeRequestTxs,
cbor.IndefLengthList{
Items: items,
},
}
return cbor.Encode(tmp)
}

func NewMsgRequestTxs(txIds []TxId) *MsgRequestTxs {
m := &MsgRequestTxs{
MessageBase: protocol.MessageBase{
Expand Down

0 comments on commit 37ebcb2

Please sign in to comment.