-
Notifications
You must be signed in to change notification settings - Fork 6
/
options.go
30 lines (26 loc) · 1.09 KB
/
options.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package tx
import "github.com/pokt-network/poktroll/pkg/client"
// WithCommitTimeoutBlocks sets the timeout duration in terms of number of blocks
// for the client to wait for broadcast transactions to be committed before
// returning a timeout error.
func WithCommitTimeoutBlocks(timeout int64) client.TxClientOption {
return func(client client.TxClient) {
client.(*txClient).commitTimeoutHeightOffset = timeout
}
}
// WithSigningKeyName sets the name of the key which should be retrieved from the
// keyring and used for signing transactions.
func WithSigningKeyName(keyName string) client.TxClientOption {
return func(client client.TxClient) {
client.(*txClient).signingKeyName = keyName
}
}
// WithConnRetryLimit returns an option function which sets the number
// of times the underlying replay client should retry in the event that it encounters
// an error or its connection is interrupted.
// If connRetryLimit is < 0, it will retry indefinitely.
func WithConnRetryLimit(limit int) client.TxClientOption {
return func(client client.TxClient) {
client.(*txClient).connRetryLimit = limit
}
}