Skip to content

fix(common): largestFirstMultiAsset changes the caller's required assets map - #888

Open
takinanton wants to merge 1 commit into
MeshJS:mainfrom
takinanton:fix/largest-first-multiasset-mutation
Open

takinanton wants to merge 1 commit into
MeshJS:mainfrom
takinanton:fix/largest-first-multiasset-mutation

Conversation

@takinanton

Copy link
Copy Markdown
Contributor

Summary

largestFirstMultiAsset writes the fee padded lovelace back into the map you pass in and UtxoSelection.largestFirstMultiAsset adds the threshold to it too. So the caller's map grows on every call and a second call with the same map picks more UTxOs.

required lovelace 1000000 -> 1876277 after one call
same map same utxos: first call 1 utxo second call 2 utxos

Both now work on a copy. New test fails on main and passes here.

Affect components

  • @meshsdk/common

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have added tests to cover my changes, if necessary

Additional Information

Built common and ran its jest. The suites that import core or core-cst need those built so I skipped them.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant