-
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
[Testing, Tooling] feat: implement in-memory networks #290
Conversation
5414460
to
e3c3f8c
Compare
11c019d
to
f03177e
Compare
Co-authored-by: harry <[email protected]> Co-authored-by: Daniel Olshansky <[email protected]>
Co-authored-by: Daniel Olshansky <[email protected]> Co-authored-by: harry <[email protected]>
…im-proof * pokt/main: Fix bug introduced by #252 where genesis file was no longer being copied to the right location [Docs] Introduce Docusaurus documentation (#252) [Cleanup] Centralzie websocket url -> endpoint changes (#272) refactor: `NewMinedRelay` to shared testutil (#262) fix: PR template typo 2 (#269) [Testing] Unit tests, E2E tests, logging and other Fixes / "Touchups" (#253) [SDK] feat: Have distinct JSON-RPC and gRPC urls (#261)
…or/supplier-keys * issues/141/refactor/claim-proof: chore: review feedback improvements chore: review feedback improvements Fix bug introduced by #252 where genesis file was no longer being copied to the right location [Docs] Introduce Docusaurus documentation (#252) [Cleanup] Centralzie websocket url -> endpoint changes (#272) refactor: `NewMinedRelay` to shared testutil (#262) fix: PR template typo 2 (#269) [Testing] Unit tests, E2E tests, logging and other Fixes / "Touchups" (#253) [SDK] feat: Have distinct JSON-RPC and gRPC urls (#261)
Co-authored-by: Daniel Olshansky <[email protected]>
…ctor/supplier-errors * issues/141/refactor/supplier-keys: chore: review feedback improvements chore: review feedback improvements Fix bug introduced by #252 where genesis file was no longer being copied to the right location [Docs] Introduce Docusaurus documentation (#252) [Cleanup] Centralzie websocket url -> endpoint changes (#272) refactor: `NewMinedRelay` to shared testutil (#262) fix: PR template typo 2 (#269) [Testing] Unit tests, E2E tests, logging and other Fixes / "Touchups" (#253) [SDK] feat: Have distinct JSON-RPC and gRPC urls (#261)
This reverts commit af531b0.
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.
Overall this is such an amazing PR! Love the attention to detail, bumped a few things (I think) got overlooked but really 11/10 this is great work.
|
||
// cliEncodeSessionHeader encodes the given session header as a base64-encoded | ||
// string. | ||
func cliEncodeSessionHeader(t *testing.T, sessionHeader *sessiontypes.SessionHeader) string { |
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.
Both optional
- Do we need
cli
in the method header? - Thoughts on moving this into the
session module types
with thesessionHeader
as a receiver?
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.
This is only used for CLI testing purposes. I don't think it would be reused anywhere.
require.NoError(t, err) | ||
require.Equal(t, float64(0), responseJson["code"], "code is not 0 in the response: %v", responseJson) | ||
|
||
// TODO_TECHDEBT: Forward the actual claim in the response once the response is updated to return it. |
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.
I don't fully understand this TODO given that we're returning it below. Can you expand?
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.
Updated:
// TODO_TECHDEBT: Forward the claim in the response, as opposed to constructing
// an equivalent one here once the response and respective message handler is
// updated to include it.
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.
Great work, amazing - love to see how its coming together. Left a few comments, once they are done I think this one is good to go, lets get it in!
@h5law Just posting here for posterity, but let's leave this until after the v0.50 migration. We may be leverage some of the newer patterns (example) as we integrate it with our specific business logic. Also spoke about it with @bryanchriswhite as well |
Co-authored-by: h5law <[email protected]>
Co-authored-by: h5law <[email protected]>
Co-authored-by: h5law <[email protected]> Co-authored-by: Daniel Olshansky <[email protected]>
Co-authored-by: h5law <[email protected]>
Co-authored-by: Daniel Olshansky <[email protected]>
@Olshansk I would definitely hold off on #307 but I think we can push this through as reviewers are able to allocate bandwidth to it. I think it represents a significant improvement from the existing tooling and can start to be used independent of the refactoring of existing integration tests. |
Discussed offline with @bryanchriswhite. Holding off on this until after the migration |
Summary
Human Summary
Adds implementations for the
InMemoryCosmosNetwork
interface from #289:BaseInMemoryCosmosNetwork
"Abstract" implementation intended to be embedded in "concrete" implementations. It implements the following interface members:
#GetClientCtx()
#GetNetworkConfig()
#GetNetwork()
Additionally, it includes the following convenience methods:
#InitializeDefaults()
#GetLastAccountSequenceNumber()
#NextAccountSequenceNumber()
inMemoryNetworkWithSessions()
Implementation where
#Start()
createsInMemoryNetworkConfig#NumSuppliers
number of genesis suppliers and#NumSuppliers * #AppToSupplierRatio
number of applications where#AppToSupplierRatio
number of applications will match one service with each supplier (in distinct pairings). It also creates corresponding on-chain accounts (auth module) for each genesis actor. It exposes#CreateClaims()
and#CreateProofs()
methods for each session *InMemoryNetworkConfig#NumSession
number of session.inMemoryNetworkWithGateways()
Implementation where
#Start()
createsInMemoryNetworkConfig#NumApplications
and#NumGateways
number of genesis applications and gateways, respectively. It also creates corresponding on-chain accounts (auth module) for each genesis actor.Issue
SubmitProof
message handling #141Type of change
Select one or more:
Testing
make go_develop_and_test
make test_e2e
devnet-test-e2e
label to the PR. This is VERY expensive, only do it after all the reviews are complete.Sanity Checklist