Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check for tx error #438

Merged
merged 2 commits into from
Nov 27, 2024
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
11 changes: 10 additions & 1 deletion relayer/chains/solana/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,16 @@ func (cl Client) GetTransaction(
signature solana.Signature,
opts *solrpc.GetTransactionOpts,
) (*solrpc.GetTransactionResult, error) {
return cl.rpc.GetTransaction(ctx, signature, opts)
txres, err := cl.rpc.GetTransaction(ctx, signature, opts)
if err != nil {
return nil, err
}

if txres.Meta != nil && txres.Meta.Err != nil {
return nil, fmt.Errorf("txn failed: %v", txres.Meta.Err)
}

return txres, nil
}

func (cl Client) GetRecentPriorityFee(
Expand Down
2 changes: 1 addition & 1 deletion relayer/chains/steller/sorobanclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func (c *Client) SubmitTransactionXDR(ctx context.Context, txXDR string) (*Trans
}

func (c *Client) waitForSuccess(ctx context.Context, txHash string) (*TransactionResponse, error) {
cntx, cncl := context.WithTimeout(ctx, time.Second*10)
cntx, cncl := context.WithTimeout(ctx, time.Second*20)
defer cncl()
ticker := time.NewTicker(time.Millisecond * 500)
defer ticker.Stop()
Expand Down