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

Issue with creating proposals #137

Open
grctest opened this issue Oct 13, 2024 · 0 comments
Open

Issue with creating proposals #137

grctest opened this issue Oct 13, 2024 · 0 comments

Comments

@grctest
Copy link
Contributor

grctest commented Oct 13, 2024

When I try to create a proposal, an invalid fee asset id is created which causes an error:

get_required_fees api error: execution error: parse error: couldn't parse uint64_t

I believe this line is the source of the issue: https://github.com/bitshares/bitsharesjs/blob/develop/lib/chain/src/TransactionBuilder.js#L431

            if (isProposal(op)) {
                op[1].proposed_ops.forEach(proposal => {
                    proposed_ops.push(proposal);
                    if (
                        proposalFeeAssets.indexOf(
                            proposal.op[1].fee.asset_id
                        ) === -1
                    )
                        proposalFeeAssets.push(
                            "1.3." + proposal.op[1].fee.asset_id
                        );
                });
            }

So, if the operation is a proposal, the idea is that we go through each proposed operation to make sure we're accounting for the use of different fee assets.

Only the line proposalFeeAssets.push("1.3." + proposal.op[1].fee.asset_id); shouldn't have the preceeding "1.3." + because the proposal op fee asset_id is already using the "1.3.x" asset id format. As this is the case, it tries to look up the fees for "1.3.1.3.0" which is an invalid asset id.

I removed this line and the uncaught error was bypassed, so we should probably change the code to something like the following:

            if (isProposal(op)) {
                op[1].proposed_ops.forEach(proposal => {
                    proposed_ops.push(proposal);
                    if (
                        proposalFeeAssets.indexOf(
                            proposal.op[1].fee.asset_id
                        ) === -1
                    )
                        proposalFeeAssets.push(proposal.op[1].fee.asset_id);
                });
            }
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