Skip to content

Commit

Permalink
add transaction ID as a field to the Transaction struct and set it in…
Browse files Browse the repository at this point in the history
… transaction builder
  • Loading branch information
QuestofIranon committed Jan 15, 2020
1 parent 36bd366 commit 3948c78
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ import (
)

type Transaction struct {
pb *proto.Transaction
pb *proto.Transaction
txnID *proto.TransactionID
}

func (transaction Transaction) ID() TransactionID {
return transactionIDFromProto(transaction.txnID)
}

func (transaction Transaction) Sign(privateKey Ed25519PrivateKey) Transaction {
Expand Down
2 changes: 1 addition & 1 deletion transaction_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (builder TransactionBuilder) Build(client *Client) Transaction {
SigMap: &proto.SignatureMap{SigPair: []*proto.SignaturePair{}},
}

return Transaction{pb}
return Transaction{pb, builder.pb.TransactionID}
}

func (builder TransactionBuilder) Execute(client *Client) (TransactionID, error) {
Expand Down

0 comments on commit 3948c78

Please sign in to comment.