Skip to content

Commit

Permalink
leave fireblocks external tx id empty (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-shim authored Apr 25, 2024
1 parent 4b44d66 commit 954cd76
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
15 changes: 8 additions & 7 deletions chainio/clients/fireblocks/contract_call.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ type extraParams struct {
}

type ContractCallRequest struct {
Operation TransactionOperation `json:"operation"`
ExternalTxID string `json:"externalTxId"`
AssetID AssetID `json:"assetId"`
Source account `json:"source"`
Destination account `json:"destination"`
Amount string `json:"amount,omitempty"`
ExtraParameters extraParams `json:"extraParameters"`
Operation TransactionOperation `json:"operation"`
// ExternalTxID is an optional field that can be used as an idempotency key.
ExternalTxID string `json:"externalTxId,omitempty"`
AssetID AssetID `json:"assetId"`
Source account `json:"source"`
Destination account `json:"destination"`
Amount string `json:"amount,omitempty"`
ExtraParameters extraParams `json:"extraParameters"`
// In case a transaction is stuck, specify the hash of the stuck transaction to replace it
// by this transaction with a higher fee, or to replace it with this transaction with a zero fee and drop it from the blockchain.
ReplaceTxByHash string `json:"replaceTxByHash,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion chainio/clients/wallet/fireblocks_wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func (t *fireblocksWallet) SendTransaction(ctx context.Context, tx *types.Transa
}

req := fireblocks.NewContractCallRequest(
tx.Hash().Hex(),
"", // externalTxID
assetID,
account.ID, // source account ID
contract.ID, // destination account ID
Expand Down
2 changes: 1 addition & 1 deletion chainio/clients/wallet/fireblocks_wallet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ func TestSendTransactionReplaceTx(t *testing.T) {
TxHash: expectedTxHash,
}, nil)
fireblocksClient.EXPECT().ContractCall(gomock.Any(), fireblocks.NewContractCallRequest(
replacementTx.Hash().Hex(),
"",
"ETH_TEST3",
"vaultAccountID",
"contractID",
Expand Down

0 comments on commit 954cd76

Please sign in to comment.