Skip to content

Commit eaff747

Browse files
authored
fix: initialise vec with required singatures len (#3467)
* fix: initialise vec with required singatures len * fix: we have to use push instead of refering index
1 parent 9873ed4 commit eaff747

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tee-worker/omni-executor/intent/executors/cross-chain/src/single_chain.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,9 @@ impl<BinanceClient: BinanceApi, SolanaClient: SolanaClientTrait>
350350
// Note: this is being done in the Go code as well, so although we technically have
351351
// only one signature we are still filling all the required placeholder
352352
// with the same signature
353-
for i in 0_usize..num_required_signatures {
354-
tx.signatures[i] = signature;
353+
tx.signatures = Vec::with_capacity(num_required_signatures);
354+
for _ in 0_usize..num_required_signatures {
355+
tx.signatures.push(signature);
355356
}
356357
tx.verify().map_err(|e| {
357358
error!("Solana transaction verification failed: {:?}", e);

0 commit comments

Comments
 (0)