chainntnfs: export NotifierOptions and internal field for interface use

Export NotifierOptions and its internal field to enable external
satisfaction of the protofsm.DaemonAdapters interface.
This commit is contained in:
ffranr
2025-07-02 16:28:44 +01:00
committed by Oliver Gugger
parent 8a185a12d1
commit 9345eb247d
2 changed files with 14 additions and 14 deletions

View File

@@ -70,28 +70,28 @@ func (t TxConfStatus) String() string {
}
}
// notifierOptions is a set of functional options that allow callers to further
// NotifierOptions is a set of functional options that allow callers to further
// modify the type of chain event notifications they receive.
type notifierOptions struct {
// includeBlock if true, then the dispatched confirmation notification
type NotifierOptions struct {
// IncludeBlock if true, then the dispatched confirmation notification
// will include the block that mined the transaction.
includeBlock bool
IncludeBlock bool
}
// defaultNotifierOptions returns the set of default options for the notifier.
func defaultNotifierOptions() *notifierOptions {
return &notifierOptions{}
// DefaultNotifierOptions returns the set of default options for the notifier.
func DefaultNotifierOptions() *NotifierOptions {
return &NotifierOptions{}
}
// NotifierOption is a functional option that allows a caller to modify the
// events received from the notifier.
type NotifierOption func(*notifierOptions)
type NotifierOption func(*NotifierOptions)
// WithIncludeBlock is an optional argument that allows the calelr to specify
// WithIncludeBlock is an optional argument that allows the caller to specify
// that the block that mined a transaction should be included in the response.
func WithIncludeBlock() NotifierOption {
return func(o *notifierOptions) {
o.includeBlock = true
return func(o *NotifierOptions) {
o.IncludeBlock = true
}
}