Skip to content

Commit

Permalink
return tx hash for TryRetrieve method
Browse files Browse the repository at this point in the history
  • Loading branch information
Pantani committed Dec 4, 2024
1 parent 420c316 commit c623782
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ignite/pkg/cosmosfaucet/try_retrieve.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TryRetrieve(
rpcAddress,
faucetAddress,
accountAddress string,
) error {
) (string, error) {
var faucetURL *url.URL
var err error

Expand All @@ -35,7 +35,7 @@ func TryRetrieve(
faucetURL, err = discoverFaucetURL(ctx, chainID, rpcAddress)
}
if err != nil {
return err
return "", err
}

ctx, cancel := context.WithTimeout(ctx, faucetTimeout)
Expand All @@ -47,13 +47,13 @@ func TryRetrieve(
AccountAddress: accountAddress,
})
if err != nil {
return errors.Wrap(err, "faucet is not operational")
return "", errors.Wrap(err, "faucet is not operational")
}
if resp.Error != "" {
return errors.Errorf("faucet is not operational: %s", resp.Error)
return "", errors.Errorf("faucet is not operational: %s", resp.Error)
}

return nil
return resp.Hash, nil
}

func discoverFaucetURL(ctx context.Context, chainID, rpcAddress string) (*url.URL, error) {
Expand Down

0 comments on commit c623782

Please sign in to comment.