-
Notifications
You must be signed in to change notification settings - Fork 0
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
High-level declarative workload classes implementation issues #2
Comments
The above issues are fixed 👍 Additional remarks:
Next tasksT1. The caliper/packages/caliper-core/lib/worker/workload/declarative/contract-function-parameter.js Lines 44 to 47 in 8128511
T2. The caliper/packages/caliper-core/lib/worker/workload/declarative/contract-function.js Lines 38 to 40 in 8128511
T3. The DeclarativeWorkloadModuleBase class should have a "selector" variable, that can select a uniformly random contract name from the available contracts (reusing hardwired value provider objects that achieve exactly what we want). T4. The Contract class should have a "selector" variable, that can select a uniformly random function name from the available functions (reusing hardwired value provider objects that achieve exactly what we want). |
Next remarks:
|
Issues
TasksT1. Randomly select a contract function, and return its generated arguments:
T2. Randomly select a contract and returns its (randomly selected function's) generated arguments: caliper/packages/caliper-core/lib/worker/workload/declarative/declarative-workload-module-base.js Line 71 in e5e18fa
T3. submitTransaction should call a new submitWithArguments(generatedArguments) function, that can be implemented by derived classes (it should throw an error in the DeclarativeWorkloadModuleBase class). So as for now, we leave the actual "custom args to connector args" transformation to be implemented in derived classes, and we won't automate it for now.
|
Awesome 👍 The only thing left is to expose the workload module class from the core package, so users can use it for their workload modules as a base class. Just add a similar export to the end of this file: caliper/packages/caliper-core/index.js Line 32 in 361c03b
|
DeclarativeWorkloadModuleBase
should just simply extend theWorkloadModuleBase
class, which performs most of the initialization. Then theinitializeWorkloadModule
function can be overridden to perform the extra init step (after calling thesuper
init).caliper/packages/caliper-core/lib/worker/workload/declarative/declarative-workload-module-base.js
Line 24 in 64f0a67
this.something = {};
insteadcaliper/packages/caliper-core/lib/worker/workload/declarative/declarative-workload-module-base.js
Line 88 in 64f0a67
caliper/packages/caliper-core/lib/worker/workload/declarative/declarative-workload-module-base.js
Line 96 in 64f0a67
for(const key of Object.keys(roundArguments)) { ... }
to iterate through the keys of an object.caliper/packages/caliper-core/lib/worker/workload/declarative/declarative-workload-module-base.js
Line 89 in 64f0a67
caliper/packages/caliper-core/lib/worker/workload/declarative/declarative-workload-module-base.js
Line 95 in 64f0a67
for(const contractObject of roundArguments.contracts) {...}
(instead ofin
)caliper/packages/caliper-core/lib/worker/workload/declarative/declarative-workload-module-base.js
Line 97 in 64f0a67
caliper/packages/caliper-core/lib/worker/workload/declarative/declarative-workload-module-base.js
Line 98 in 64f0a67
caliper/packages/caliper-core/lib/worker/workload/declarative/contract.js
Lines 29 to 30 in 64f0a67
caliper/packages/caliper-core/lib/worker/workload/declarative/contract.js
Line 32 in 64f0a67
You need to construct an object for each function and store them:
The text was updated successfully, but these errors were encountered: