Skip to content

Commit 5d59f3d

Browse files
committed
fix: replace with empty string in input group rename witness
1 parent e1064d4 commit 5d59f3d

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

packages/neuron-wallet/src/services/wallets.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -393,15 +393,15 @@ export default class WalletService {
393393
witnessesArgs[0].witnessArgs.lock = '0x' + '0'.repeat(130)
394394

395395
const privateKey = findPrivateKey(witnessesArgs[0].blake160)
396-
const signedWitness = core.signWitnesses(privateKey)({
396+
const signed = core.signWitnesses(privateKey)({
397397
transactionHash: txHash,
398-
witnesses: witnessesArgs.map(w => w.witnessArgs)
399-
})[0] as string
398+
witnesses: [witnessesArgs[0].witnessArgs, ...Array.from({length: witnessesArgs.length - 1}).map(() => '0x')]
399+
})
400+
const signedWitness = signed[0] as string
400401

401-
for (const w of witnessSigningEntries) {
402-
if (w.lockHash === lockHash) {
403-
w.witness = '0x'
404-
}
402+
const entires = witnessSigningEntries.filter(e => e.lockHash === lockHash)
403+
for (let i = 0; i < entires.length; ++i) {
404+
entires[i].witness = signed[i] as string
405405
}
406406
witnessSigningEntries[firstIndex].witness = signedWitness
407407
}

0 commit comments

Comments
 (0)