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

Adds migrate utxos test #206

Open
wants to merge 4 commits into
base: add-register-svp-spend-tx-test
Choose a base branch
from

Conversation

jeremy-then
Copy link
Contributor

No description provided.

@jeremy-then jeremy-then self-assigned this Jan 21, 2025
@jeremy-then jeremy-then requested a review from a team as a code owner January 21, 2025 23:00
@jeremy-then jeremy-then force-pushed the add-migration-utxos-test branch from cf73641 to 9685358 Compare January 21, 2025 23:41
@jeremy-then jeremy-then force-pushed the add-register-svp-spend-tx-test branch from 6287d0b to 2763721 Compare January 28, 2025 00:45
@jeremy-then jeremy-then force-pushed the add-migration-utxos-test branch from 9685358 to 8bfe343 Compare January 28, 2025 00:55
Comment on lines 487 to 491
const migrationReleaseBtcTxInputsTxHashes = migrationReleaseBtcTransaction.ins.map(input => input.hash.reverse().toString('hex'));
const svpSpendTxUtxoHashesNotPresentInTheBridgeStateBeforeActivation = findSvpSpendTxUtxoHashNotPresentInTheBridgeStateBeforeActivation(bridgeStateBeforeActivation.activeFederationUtxos, migrationReleaseBtcTxInputsTxHashes);
expect(svpSpendTxUtxoHashesNotPresentInTheBridgeStateBeforeActivation.length).to.be.equal(1, 'There should be one missing hash, the utxo that was sent to the Proposed federation in the SVP Spend transaction.');
const actualSvpSpendTxHash = svpSpendTxUtxoHashesNotPresentInTheBridgeStateBeforeActivation[0];
expect(actualSvpSpendTxHash).to.be.equal(svpSpendBtcTransaction.getId(), 'The missing hash should be the SVP Spend transaction hash.');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't you just search for the svpSpendBtcTransactionHash in the migrationReleaseBtcTxInputsTxHashes ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed some of these variables. Also, what I usually do is connect everything in multiple ways to ensure they all connect.
In this section, I'm not only making sure the "svpSpendBtcTransactionHash" is in the migration transaction (indirectly), but I'm also making sure all the utxos that were in the Bridge are in the migration transaction as well.
Check now.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you change anything?

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.

2 participants