Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: simvalery <[email protected]>

Signed-off-by: simvalery <[email protected]>
  • Loading branch information
simvalery committed Apr 29, 2024
1 parent 7d6438a commit 65b1ec6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions worker-service/src/api/helpers/hedera-sdk-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -933,10 +933,10 @@ export class HederaSDKHelper {
signData.vaultId,
signData.assetId,
);

messageTransaction.setNodeAccountIds(Object.values(this.client.network) as AccountId[]);
const accountIds = Object.values(this.client.network) as AccountId[];
messageTransaction.setNodeAccountIds([accountIds[0]]);
messageTransaction = messageTransaction.freezeWith(client);
// messageTransaction = await messageTransaction.sign(HederaUtils.parsPrivateKey(privateKey));
messageTransaction = await messageTransaction.sign(HederaUtils.parsPrivateKey(privateKey));
const tx = await fireblocksClient.createTransaction(messageTransaction.toBytes());

if (!tx || !Array.isArray(tx.signedMessages)) {
Expand All @@ -947,7 +947,11 @@ export class HederaSDKHelper {
if (signedMessage) {
const pubKey = PublicKey.fromStringED25519(signedMessage.publicKey);
const signature = Buffer.from(signedMessage.signature.fullSig, 'hex');
messageTransaction.addSignature(pubKey, signature);
try {
messageTransaction.addSignature(pubKey, signature);
} catch (error) {
throw new Error(error);
}
}
break;
}
Expand Down

0 comments on commit 65b1ec6

Please sign in to comment.