-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Miner] feat: add TxContext
#118
Conversation
return txCtxMock | ||
} | ||
|
||
func NewAnyTimesTxTxContext( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@h5law PTAL re: mocking cosmos' client context object...
dd1980e
to
59f0c90
Compare
abbab6c
to
493ce8c
Compare
64b7ba6
to
1149012
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No blockers. Just a couple NITs & questions, but otherwise g2g!
(cherry picked from commit 78184e523e62450fe5fc7fe1d23906213e8c81bc)
* pokt/main: [Miner] feat: add block client (#65) [Supplier] Add `ServiceConfigs` to `SupplierStaking` (#114) [AppGate] Add the MaxDelegatedGateways parameter (#109) [Test] Temporarily skip a flaky test `TestEventsQueryClient_Subscribe_Succeeds` (#121) [AppGate] Implement DelegateToGateway and add Tests (#90) [E2E] Add (Un)Stake Tests (#88)
(cherry picked from commit e2303a5b776830815457f12f5e371e916e3bee93)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple NITs but LGTM otherwise!
@@ -1,4 +1,4 @@ | |||
//go:generate mockgen -destination=../../internal/mocks/mockclient/events_query_client_mock.go -package=mockclient . Dialer,Connection | |||
//go:generate mockgen -destination=../../internal/mocks/mockclient/events_query_client_mock.go -package=mockclient . Dialer,Connection,EventsQueryClient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing we have different packages but keep them defined in interface.go
, it'll be really nice to get a sense of all the different interfaces we have available.
In fact, this is how I went down the #128 🐇 hole
* pokt/main: [Testing] fix: flaky tests in observable & client pkgs (#124) Added first roadmap change
…plementation * pokt/main: (28 commits) [Miner] feat: add supplier client (#42) [Off-chain] refactor: keyring errors & helpers (#131) [Miner] feat: add `TxClient` (#94) [CI] Build container images (#107) fix: flaky block client test (#132) [Tooling] add `go_lint` & `go_imports` make targets & CI step (#129) Update README.md [Code Health] Support `godoc` by replacing the `pocket `module name with `github.com/pokt-network/poktroll` (#128) [Miner] feat: add `TxContext` (#118) [Testing] fix: flaky tests in observable & client pkgs (#124) Added first roadmap change [AppGate] Implement UndelegateFromGateway with Extensive Tests (#125) [Miner] feat: add block client (#65) [Supplier] Add `ServiceConfigs` to `SupplierStaking` (#114) [AppGate] Add the MaxDelegatedGateways parameter (#109) [Test] Temporarily skip a flaky test `TestEventsQueryClient_Subscribe_Succeeds` (#121) [AppGate] Implement DelegateToGateway and add Tests (#90) [E2E] Add (Un)Stake Tests (#88) refactor: add `either.Bytes` alias (#117) feat: add either.AsyncErr type & helpers (#115) ...
* chore: add `TxContext` interface * feat: add `cosmosTxContext` implementation * test: add `TxContext` test helpers * chore: move godoc comment above `AsyncError` * fixup: goimports * chore: add godoc comments to tx context test helpers * chore: cleanup * chore: add godoc comments to common testclient helpers * chore: review feedback improvements (cherry picked from commit 78184e523e62450fe5fc7fe1d23906213e8c81bc) * chore: update comments * refactor: simplify tx context teset helpers (cherry picked from commit e2303a5b776830815457f12f5e371e916e3bee93) * chore: add godoc comments
Summary
Human Summary
Adds
TxContext
interface &cosmosTxContext
implementation which abstracts cosmos-specific API into discrete concerns.AI Summary
Summary generated by Reviewpad on 02 Nov 23 11:30 UTC
This pull request includes various changes across multiple files.
In the
internal/testclient
package:common.go
has been deleted, which contained theCometLocalWebsocketURL
constant set to"ws://localhost:36657/websocket"
.keyring.go
has been added, which defines theNewKey
function for generating a new key and mnemonic for testing purposes.In the package
testclient
:localnet.go
has been added, which includes various imports, functions, and constants related to localnet testing. Some notable additions include theCometLocalWebsocketURL
constant and theEncodingConfig
variable.In the
either
package:types.go
file has been modified to include changes to theAsyncError
type and the introduction of theBytes
type.In the
pkg/client/tx
package:context.go
file has been added, which defines thecosmosTxContext
struct implementing theclient.TxContext
interface. This file also includes various methods related to transaction context within the Cosmos SDK.In the
interface.go
file:go:generate
directives, import packages, and introduce new interfaces for the client, keyring, and types.These changes add functionality related to localnet testing, key generation, transaction context, and types across multiple packages.
Issue
Relates to:
TxClient
#94TxContext
Type of change
Select one or more:
Testing
make go_develop_and_test
Sanity Checklist