Skip to content
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

sample usage assertion error #12

Open
dev-dantealighieri opened this issue Aug 9, 2024 · 0 comments
Open

sample usage assertion error #12

dev-dantealighieri opened this issue Aug 9, 2024 · 0 comments

Comments

@dev-dantealighieri
Copy link

hi, getSampledUsage function was working normally, but nowadays i only get assertion error from it.

What might be the reason, is there way that i can solve this? if not, what default values that i can use for Uint128 cpu and net values that returns from sample usage method that is used for cpu and net price calculations.

if none of these works, is there any other way that i can get cpuPrice, netPrice of the current state?

    const eosResources = new Resources({
      api: apiClient,
    });

    const powerup = await eosResources.v1.powerup.get_state();

    let sampleUsage: SampleUsage;
    try {
      sampleUsage = await eosResources.getSampledUsage();
    } catch (error) {
      sampleUsage = defaultSampleUsage();
    }
error: Assertion failed
stack: 'Error: Assertion failed\n    at assert (/Users/dante/Documents/Codes/eos/node_modules/bn.js/lib/bn.js:6:21)\n    at BN.divmod (/Users/dante/Documents/Codes/eos/node_modules/bn.js/lib/bn.js:2342:5)\n    at BN.div (/Users/dante/Documents/Codes/eos/node_modules/bn.js/lib/bn.js:2438:17)\n    at divCeil (/Users/dante/Documents/Codes/eos/node_modules/@wharfkit/resources/src/index.ts:80:21)\n    at Resources.<anonymous> (/Users/dante/Documents/Codes/eos/node_modules/@wharfkit/resources/src/index.ts:73:18)\n    at Generator.next (<anonymous>)\n    at fulfilled (/Users/dante/Documents/Codes/eos/node_modules/@wharfkit/resources/node_modules/tslib/tslib.js:166:62)\n    at processTicksAndRejections (node:internal/process/task_queues:95:5)'

thanks, dante

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant