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

[TX] Fix owner auth signatures indices for DepositTx + examples #84

Merged
merged 4 commits into from
Nov 2, 2023

Conversation

knikos
Copy link
Member

@knikos knikos commented Nov 1, 2023

Why this should be merged

When building a deposit tx for a restricted offer from an msig wallet, a certain logic with pseudo addresses is incorporated
(see https://github.com/chain4travel/caminojs/blob/dev/src/apis/platformvm/builder.ts#L1387) to facilitate the processing of signatures in case of a multisig keychain.
However, when building the signature indices in the case of the deposit offer owner, the key cannot be found unless you add it to the keychain with the same pseudo address. See https://github.com/chain4travel/caminojs/blob/dev/src/common/multisigkeychain.ts#L250

How this works

This PR addresses this issue by refactoring addOwnerAuth and adding the pseudo addresses in the indices. Thus, when adding the owner signatures to the ms keychain using the getOwnerSignatures, there will be a match between the pseudo addresses set in the Output Owners via the builder and the ones added via addOwnerAuth.

How this was tested

See new examples.

Copy link

github-actions bot commented Nov 1, 2023

⚠️ Found errors/fatal log records. Please review them(job:e2e, step:"Check produced logs") and resolve this comment.

2 errors
0 fatal

@knikos knikos force-pushed the bugfix/deposit-owner-signature-logic branch from ffed39f to 8dd81cc Compare November 1, 2023 12:36
@knikos knikos requested review from peak3d and c4t-ag November 1, 2023 12:39
@knikos knikos marked this pull request as ready for review November 1, 2023 13:56
@knikos knikos merged commit ee6bcbe into dev Nov 2, 2023
6 checks passed
@knikos knikos deleted the bugfix/deposit-owner-signature-logic branch November 2, 2023 13:41
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