Conversation
Deflationary payment routing primitive with 5 gate modes: SPLIT, ROUND_ROBIN, THRESHOLD, RANDOM, CONDITIONAL. All fees burned via qpi.burn(). Permissionless, multi-tenant. Local testnet verified on core-lite.
cyber-pc
left a comment
There was a problem hiding this comment.
Please also add an unit test for the end epoch to make sure it works as your expectation.
| } | ||
| } | ||
|
|
||
| PUBLIC_PROCEDURE_WITH_LOCALS(closeGate) |
There was a problem hiding this comment.
Please add the braces in this function according to https://github.com/qubic/core/blob/main/doc/contributing.md#curly-braces-style for all belows
if (qpi.invocationReward() > 0)
qpi.transfer(qpi.invocator(), qpi.invocationReward());
| LOG_INFO(locals.logger); | ||
| } | ||
|
|
||
| PUBLIC_PROCEDURE_WITH_LOCALS(updateGate) |
There was a problem hiding this comment.
Please add the braces in this function according to https://github.com/qubic/core/blob/main/doc/contributing.md#curly-braces-style for all belows
if (qpi.invocationReward() > 0)
qpi.transfer(qpi.invocator(), qpi.invocationReward());
| PUBLIC_FUNCTION_WITH_LOCALS(getGatesByOwner) | ||
| { | ||
| output.count = 0; | ||
| for (locals.i = 0; locals.i < state._gateCount && output.count < 16; locals.i++) |
There was a problem hiding this comment.
Please use a named constants instead of 16 here and getGatesByOwner_output's Array<uint64, 16> gateIds; to avoid forgetting to update the loop if the gateIds is expanded.
| // Batch gate query — fetch up to 32 gates in one call | ||
| PUBLIC_FUNCTION_WITH_LOCALS(getGateBatch) | ||
| { | ||
| for (locals.i = 0; locals.i < 32; locals.i++) |
There was a problem hiding this comment.
Please use a named constants instead of 32 here and getGateBatch_input's Array<uint64, 32> gateIds;
Proposal
Interactive demo running against a live Qubic testnet node: https://qugate.fyll.co.uk/demos