Skip to content

Commit

Permalink
feature: SignBroadcastWaitTransaction()
Browse files Browse the repository at this point in the history
  • Loading branch information
randomshinichi committed Sep 11, 2019
1 parent 8618d52 commit 733cde4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions aeternity/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,3 +417,15 @@ func SignBroadcastTransaction(tx rlp.Encoder, signingAccount *Account, n *Node,
}
return
}

// SignBroadcastWaitTransaction is a convenience function that runs
// SignBroadcastTransaction and then blocks until the tx is found or x blocks
// have gone by.
func SignBroadcastWaitTransaction(tx rlp.Encoder, signingAccount *Account, n *Node, networkID string, x uint64) (signedTxStr, hash, signature string, blockHeight uint64, blockHash string, err error) {
signedTxStr, hash, signature, err = SignBroadcastTransaction(tx, signingAccount, n, networkID)
if err != nil {
return
}
blockHeight, blockHash, err = WaitForTransactionForXBlocks(n, hash, x)
return
}

0 comments on commit 733cde4

Please sign in to comment.