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

Credit withdrawal doesn't calculate Core fee/byte correctly #2233

Open
thephez opened this issue Oct 9, 2024 · 0 comments
Open

Credit withdrawal doesn't calculate Core fee/byte correctly #2233

thephez opened this issue Oct 9, 2024 · 0 comments
Assignees
Labels
bug Something isn't working js-sdk JS Dash SDK related

Comments

@thephez
Copy link
Collaborator

thephez commented Oct 9, 2024

Expected Behavior

A withdrawal can be done simply by running something like:

client.platform.identities.withdrawCredits(identity, withdrawalAmount, { toAddress });

Current Behavior

This error is returned:
StateTransitionBroadcastError: Core fee per byte 0 must be part of fibonacci sequence and not less than 1]

Possible Solution

The following appears to work:

client.wallet.storage.getDefaultChainStore().state.fees.minRelay = 1000
client.platform.identities.withdrawCredits(identity, withdrawalAmount, { toAddress });

It appears minRelay in at least some cases is 0 (actually -0). This results in a value of -1 being returned as the coreFeePerByte here: https://github.com/dashpay/platform/blob/v1.4-dev/packages/js-dash-sdk/src/SDK/Client/Platform/methods/identities/creditWithdrawal.ts#L89-L94

Steps to Reproduce (for bugs)

Run this with a valid identity, amount, and address:

client.platform.identities.withdrawCredits(identity, withdrawalAmount, { toAddress });

Context

Your Environment

  • Version used: JS SDK 1.4-dev.8 against testnet
  • Environment name and version (e.g. Chrome 39, node.js 5.4): Node 20.10
  • Operating System and version (desktop, server, or mobile): Ubuntu 22
@thephez thephez added bug Something isn't working js-sdk JS Dash SDK related labels Oct 9, 2024
@shumkov shumkov self-assigned this Oct 17, 2024
@shumkov shumkov moved this to Todo in Platform team Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working js-sdk JS Dash SDK related
Projects
Status: Todo
Development

No branches or pull requests

2 participants