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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple non-consecutive signers issue #132

Open
ctubio opened this issue Jan 29, 2024 · 0 comments
Open

multiple non-consecutive signers issue #132

ctubio opened this issue Jan 29, 2024 · 0 comments

Comments

@ctubio
Copy link

ctubio commented Jan 29, 2024

馃巵 hiii

i do believe the following function works nice for groups with a single signer or with multiple consecutive, liike:

  • txn0: signerA

or

  • utxn0: signerA
  • stxn1: signerB
  • stxn2: signerB

is returned as-is

but in case of non-consecutive, it returns duplicated txns and while duplicating misses the txn on each replaced index, liike:

  • utxn0: signerA
  • stxn1: signerB
  • utxn2: signerA

is returned as:

  • utxn0: signerA
  • stxn1: signerB
  • stxn1: signerB

(note utxn2 is lost and replaced by a duplicated stxn1)

(note虏 in the examples, signerA will sign a txn, and signerB already signed it so will not sign nothing on this request)

const signedTxns = transactions.reduce<Uint8Array[]>((acc, txn, i) => {
if (signedIndexes.includes(i)) {
const signedByUser = result.shift()
signedByUser && acc.push(signedByUser)
} else if (returnGroup) {
acc.push(transactions[i])
}
return acc
}, [])

thank you for your awesome work'隆

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