Skip to content

improve checkDeltaBalance #30

@rognierbenoit

Description

@rognierbenoit

checkDeltaBalance should take an extra parameter: an epsilon tolerance when checking balance delta.

This is to replace the ususal pattern:

await checkBalanceDelta(user.pkh, (d) => checkEqualEpsilon(d, -10, 0.02), async () => {
 ...
})

where checkEqualEpsilon is:

const checkEqualEpsilon = (value, target, epsilon) => Math.abs(value - target) < epsilon;

Hence the call below should be:

await checkBalanceDelta(user.pkh, -10, 0.02, async () => {
 ...
})

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions