Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidEventsSequence is the error returned when the returned sequence // of events is invalid. ErrInvalidEventsSequence = fmt.Errorf( "server returned invalid events sequence", ) // ErrRequestedBoundariesViolated is the error returned when the sequence of // events returned from the server violate the requested boundaries. ErrRequestedBoundariesViolated = fmt.Errorf( "server returned events sequence violating requested boundaries", ) )
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client connects to the Ethereum sidecar server and queries for the `AssetsLocked` events.
func (*Client) GetAssetsLockedEvents ¶
func (c *Client) GetAssetsLockedEvents( ctx context.Context, sequenceStart sdkmath.Int, sequenceEnd sdkmath.Int, ) ([]bridgetypes.AssetsLockedEvent, error)
GetAssetsLockedEvents returns confirmed AssetsLockedEvents with the sequence number falling within the half-open range, denoted by sequenceStart (included) and sequenceEnd (excluded). Nil can be passed for sequenceStart and sequenceEnd to indicate an unbounded edge of the range.
type ClientMock ¶
type ClientMock struct{}
ClientMock is the mock implementation of the Ethereum sidecar client used in contexts where there is no need for a server connection.
func NewClientMock ¶
func NewClientMock() *ClientMock
func (*ClientMock) GetAssetsLockedEvents ¶
func (cm *ClientMock) GetAssetsLockedEvents( _ context.Context, _ sdkmath.Int, _ sdkmath.Int, ) ([]bridgetypes.AssetsLockedEvent, error)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server observes events emitted by the Mezo `BitcoinBridge` contract on the Ethereum chain. It enables retrieval of information on the assets locked by the contract. It is intended to be run as a separate process.
func (*Server) AssetsLockedEvents ¶
func (s *Server) AssetsLockedEvents( _ context.Context, req *pb.AssetsLockedEventsRequest, ) ( *pb.AssetsLockedEventsResponse, error, )
AssetsLockedEvents returns a list of AssetsLocked events based on the passed request. It is executed by the gRPC server.