-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scaffold smart contract event storage (#105)
## tl;dr - Adds function to run log streamer and store events - Creates flexible interface for deserializing and storing events - Updates mockery config and moves all mocks to a dedicated folder ## AI Assisted summary - **blockchain/interfaces**: Remove `Stop()` method from `LogStreamer` interface, add custom logger name to `RpcLogStreamer`. - **blockchain/rpcLogStreamer.go**: Add buffered channel to `ListenForContractEvent` to improve event handling. - **indexer/indexer.go**: Add new file for starting the indexer service with configuration for message contract events. - **storer**: Implement error handling for the log storer, including support for retryable errors. Add mock for `LogStorer`. - **Refactoring**: Move existing mock generation to the 'mocks' package for better code organization. - **server/options.go**: Integrate `ContractsOptions` into the server options for configuration.
- Loading branch information
Showing
15 changed files
with
314 additions
and
561 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
with-expecter: True | ||
inpackage: True | ||
dir: "{{.InterfaceDir}}" | ||
testonly: True | ||
dir: pkg/mocks | ||
mockname: "Mock{{.InterfaceName}}" | ||
outpkg: "{{.PackageName}}" | ||
filename: "mock_{{.InterfaceName}}_test.go" | ||
outpkg: mocks | ||
filename: "mock_{{.InterfaceName}}.go" | ||
packages: | ||
github.com/xmtp/xmtpd/pkg/indexer/blockchain: | ||
interfaces: | ||
ChainClient: | ||
github.com/xmtp/xmtpd/pkg/indexer/storer: | ||
interfaces: | ||
LogStorer: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.