Skip to content

Commit

Permalink
check
Browse files Browse the repository at this point in the history
  • Loading branch information
augustbleeds committed May 6, 2024
1 parent 3b761cc commit d992429
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion relayer/pkg/starknet/chain_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,15 @@ func (c *Client) ChainId(ctx context.Context) (string, error) {
results, err := c.Batch(ctx, NewBatchBuilder().RequestChainId())

if err != nil {
return "", fmt.Errorf("error in ChainId: %w", err)
return "", fmt.Errorf("error in ChainId : %w", err)
}

if len(results) != 1 {
return "", fmt.Errorf("unexpected result from ChainId")
}

if results[0].Error != nil {
return "", fmt.Errorf("error in ChainId result: %w", results[0].Error)
}

chainId, ok := results[0].Result.(*string)
Expand Down

0 comments on commit d992429

Please sign in to comment.