forked from TrueCloudLab/frostfs-node
[#1966] neofs-adm: Fix signature creation for multiactor scenario
`SignTx` from neo-go appended verification script only if `Scripts` array was not completely filled. ``` can't persist transactions: transaction b9cd02fb81721c7316c908687301eeaf8ef384e381476632c24a77bdf9ffacd5 failed to verify: witness #1: unknown verification contract ``` Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
parent
2dcf8d51be
commit
4fe1aad30f
1 changed files with 7 additions and 5 deletions
|
@ -130,13 +130,15 @@ func (c *initializeContext) multiSign(tx *transaction.Transaction, accType strin
|
|||
return fmt.Errorf("incomplete signature: %w", err)
|
||||
}
|
||||
|
||||
if len(tx.Scripts) == 0 {
|
||||
tx.Scripts = make([]transaction.Witness, len(tx.Signers))
|
||||
}
|
||||
|
||||
for i := range tx.Signers {
|
||||
if tx.Signers[i].Account == h {
|
||||
if i < len(tx.Scripts) {
|
||||
tx.Scripts[i] = *w
|
||||
} else if i == len(tx.Scripts) {
|
||||
tx.Scripts = append(tx.Scripts, *w)
|
||||
} else {
|
||||
panic("BUG: invalid signing order")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue