Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions pkg/chains/evm/evm.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/chains/evm/evm.proto
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ message SubmitTransactionRequest {
message SubmitTransactionReply {
bytes txHash = 1;
TxStatus txStatus = 2;
string tx_idempotency_key = 3; // idempotency key generated for this transaction
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are txHash and tx_idempotency_key related in any way? we do that for workflowExecutionIDs, and it tends to be pretty useful in scenarios when you need to forecast an execution ID

}

// TransactionStatus is an enum for the status of a transaction.
Expand Down
10 changes: 6 additions & 4 deletions pkg/loop/internal/relayer/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ func (e *EVMClient) SubmitTransaction(ctx context.Context, txRequest evmtypes.Su
}

return &evmtypes.TransactionResult{
TxStatus: evmpb.ConvertTxStatusFromProto(reply.TxStatus),
TxHash: evmtypes.Hash(reply.TxHash),
TxStatus: evmpb.ConvertTxStatusFromProto(reply.TxStatus),
TxHash: evmtypes.Hash(reply.TxHash),
TxIdempotencyKey: reply.TxIdempotencyKey,
}, nil
}

Expand Down Expand Up @@ -514,8 +515,9 @@ func (e *evmServer) SubmitTransaction(ctx context.Context, request *evmpb.Submit
return nil, err
}
return &evmpb.SubmitTransactionReply{
TxHash: txResult.TxHash[:],
TxStatus: evmpb.ConvertTxStatusToProto(txResult.TxStatus),
TxHash: txResult.TxHash[:],
TxStatus: evmpb.ConvertTxStatusToProto(txResult.TxStatus),
TxIdempotencyKey: txResult.TxIdempotencyKey,
}, nil
}

Expand Down
5 changes: 3 additions & 2 deletions pkg/loop/internal/relayerset/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,9 @@ func (s *Server) SubmitTransaction(ctx context.Context, request *evmpb.SubmitTra
}

return &evmpb.SubmitTransactionReply{
TxHash: txResult.TxHash[:],
TxStatus: evmpb.ConvertTxStatusToProto(txResult.TxStatus),
TxHash: txResult.TxHash[:],
TxStatus: evmpb.ConvertTxStatusToProto(txResult.TxStatus),
TxIdempotencyKey: txResult.TxIdempotencyKey,
}, nil
}

Expand Down
5 changes: 3 additions & 2 deletions pkg/types/chains/evm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ func (e *TxError) Error() string {

// PLEX-1524 - Refactor this to return the Tx Hash in a Transaction type and a second return value for the TxStatus. We may even be able to return the whole transaction object instead of just the hash.
type TransactionResult struct {
TxStatus TransactionStatus
TxHash Hash
TxStatus TransactionStatus
TxHash Hash
TxIdempotencyKey string // Idempotency key used for tracking purposes of transactions.
}

type GasConfig struct {
Expand Down
Loading