Closed yihuang closed 2 months ago
The changes involve modifications to the gen_genesis
function in peer.py
, specifically adjusting the handling of the accounts
list to exclude the first account, which is the validator account of the first node. Additionally, an optional command-line argument --node
is introduced in the gen_txs
function in stateless.py
, allowing users to generate transactions for a specific node. The function signatures are updated accordingly, and the path for preparing the genesis file is changed.
File Path | Change Summary |
---|---|
testground/benchmark/benchmark/peer.py | Modified gen_genesis function to skip the first account in the accounts list, ensuring only subsequent nodes are included. |
testground/benchmark/benchmark/stateless.py | Updated gen_txs and _gen_txs function signatures to include an optional node parameter. Logic modified to generate transactions conditionally based on the presence of node . Path for genesis file preparation changed from FULLNODE_GROUP to VALIDATOR_GROUP . |
gen_genesis
function in peer.py
, directly related to the changes in the main PR.stateless.py
, relevant to the changes in transaction handling.sendtx.py
, related to modifications in the accounts
list and transaction generation logic.๐ In the meadow, transactions flow,
With a node to guide, watch them grow.
A sprinkle of code, a dash of delight,
Generating paths, both day and night.
Hops of joy in every line,
A new feature's here, oh how divine! ๐ผ
testground/benchmark/benchmark/peer.py (1)
`89-93`: **LGTM!** The code change correctly skips the first account in the `accounts` list, which corresponds to the validator account of the first node. This prevents duplicating the validator account in the genesis file, as it is already added using the home directory of that node. The updated logic ensures that the `accounts` list only contains the accounts from the subsequent nodes, which is the desired behavior.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 15.24%. Comparing base (
670fd8d
) to head (cf373d1
). Report is 3 commits behind head on main.
Solution:
for example:
Run
nix run .#stateless-testcase -- --help
to make sure it's built first, because the build part can't run in parallel.๐ฎ๐ป๐ฎ๐ป๐ฎ๐ป !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! ๐ฎ๐ป๐ฎ๐ป๐ฎ๐ป
PR Checklist:
make
)make test
)go fmt
)golangci-lint run
)go list -json -m all | nancy sleuth
)Thank you for your code, it's appreciated! :)
Summary by CodeRabbit
--node
for specifying a single node during transaction generation.