Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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] chore: in-memory network interface & config types #289
[Testing, Tooling] chore: in-memory network interface & config types #289
Changes from 20 commits
4bcd8de
673911c
fd55896
43cbf0e
ef3cd99
f509fbf
6817364
6e60952
edc4e41
7994ca2
6a5b3e6
dfb067d
0351cc7
b82e49a
2d52838
6a9d6ec
5566e5c
923907b
8b57b22
93125b0
b11bbe3
f3e7866
df9e3c2
bca059c
8ab13f0
c21071b
6515c64
b4ed47c
7987e14
cdcfb7d
92c0a19
ff09a42
9f472f6
3de1971
800b53b
8e0f4e9
2b32545
f41547e
a527f23
5905d20
4248b0b
f064432
7bacad9
6d5826f
92970b9
ab3fd1e
a57273c
8486a8c
53faaac
0ada011
6df8994
2f1232c
bd60220
c648d4f
dd53efc
fea3d27
c00e1b2
7d1b1e0
dd5ea83
afbefe7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Why are we inconsistent with the usage of
accessor functions
andstate varaibles
? Please add a TODO if there's an opportunity/rationale for 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.
TL;DR, re:
#GetNumApplications()
, is computed here because of the way some network implementations use the network config.In the case of
inMemoryNetworkWithSessions
,#NumApplications
MUST be 0; therefore,#GetNumApplications()
MUST be used to compute the same value using#AppToSupplierRatio
instead.#GetNumApplications()
will use whichever (#NumApplications
/ `#AppToSupplierRatio) is populated to return the appropriate value.This constraint is enforced in the constructor.
inMemoryNetworkWithGateways
has the opposite constraint. My goal was to minimize complexity by sharing a single config with minimal necessary fields that are common to all network implementations.Re:
#GetNumKeyringAccounts()
, I'm assuming that the number of keyring accounts is strictly a function of the number of genesis actors. If we find that we want to create more keyring accounts for a particular network, I would propose adding an#NumAdditionalKeyringAccounts
field to the network config which is considered here.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.
#GetNumKeyringAccounts
. 👍 and doesn't even need a comment#GetNumApplications()
, I think we should add a comment above the return w/ something like "NumApplications is intentionally a computed field" and potentially link to this comment.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.
If
NumApplications
is not populated in the config when it is provided, it is never subsequently populated by network helpers. My intention was forNumApplications
andAppToSupplierRatio
to be inputs and `#GetNumApplications() to be the output (single source of truth). I'm reluctant to have the helpers mutate the config after it's provided. That just seems like something that would come back around to bite us later.I will add a comment saying as much, let me know what you think.
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 think the answer to #303 is in this struct somewhere.