-
Notifications
You must be signed in to change notification settings - Fork 122
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
Add mintV2
loadtest
#1285
base: main
Are you sure you want to change the base?
Add mintV2
loadtest
#1285
Conversation
Pull Request Test Coverage Report for Build 12997637530Details
💛 - Coveralls |
With the new mintV2 test we add a few extra parameters to the config file. In this PR we expose the new parameters in the sample config and add them to the config struct definition.
We make the WaitForNTxsInMempool function public as it's going to be needed in the mintV2 loadtest.
We add a new mintV2 test which mints normal assets of a configured supply into a fixed number of groups. This is an enhanced and more lightweight version of the previous mint test, as it uses less assertions and rpc calls.
b444e01
to
964f42c
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.
Nice, tACK 🎉
|
||
var assetRequests []*mintrpc.MintAssetRequest | ||
|
||
t.Logf("Minting %v assets into group %s", cfg.BatchSize, tweakedKey) |
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.
nit: %x
.
mintNewGroup(t, ctx, bitcoinClient, minter, cfg) | ||
} | ||
|
||
// If there's not any existing groups we skip the rest of the steps, we |
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.
grammar nit: "If there aren't any existing groups".
} | ||
|
||
// nolint:lll | ||
assetRequests := []*mintrpc.MintAssetRequest{ |
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.
nit: can remove a level of indentation by formatting as:
assetRequests := []*mintrpc.MintAssetRequest{{
Asset: &mintrpc.MintAsset{
AssetType: taprpc.AssetType_NORMAL,
Name: fmt.Sprintf(
"tapcoin-%d", time.Now().UnixNano(),
),
AssetMeta: &taprpc.AssetMeta{
Data: []byte("{}"),
Type: taprpc.AssetMetaType_META_TYPE_JSON,
},
Amount: mintAmt,
NewGroupedAsset: true,
DecimalDisplay: 4,
},
}}
That way we don't need the lll
nolint directive. Same below.
defer cancel() | ||
|
||
finalizeReq := &mintrpc.FinalizeBatchRequest{} | ||
// Instruct the daemon to finalize the batch. |
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.
nit: newline before comment block.
Description
This is a lighter version of the mintTest, which also uses a few more configuration parameters to control how minting occurs. We now mint normal assets into a fixed total number of groups.
This was originally intended as a rewrite of the existing mint test, but it is introduced as a totally separate function. We could keep both functions and even try to run them in parallel at some point.
The minter is fixed to Alice node, as Bob could not mint into a group that is controlled by Alice. So fixing this role to Alice makes things much simpler.