-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Description
Location
[client]
Context
Refactor of watcher for IoT use cases is described in umbrella issue: #172. To integrate the refactored watcher into the client, each channel should publish the off-chain transactions to the watcher via StatesPub interface.
type StatesPub interface {
Publish(channel.Transaction) error
}Details
New states are created for the Channel when enabling newer off-chain states. In this place, the newer state should be published to the watcher.
However, the statesPub instance will be available only after a channel is initialized and the client registers the channel with the watcher. Therefore,
- Add a field
Publisherwith typefunc(channel.Transaction) errorto theclient.Channeltype. - Implement a
NoopPublisherthat always returns nil. - When initializing the channel, set the
Publisherto aNoopPublisher. - Publish the states on the Publisher when enabling newer off-chain states.
In an upcoming pull request, NoopPublisher will be replaced by the Publisher associated with the watcher when client registers the channel with the watcher.
Metadata
Metadata
Assignees
Labels
No labels