Skip to content

Commit

Permalink
Merge pull request #12 from astriaorg/joroshiba/usenano
Browse files Browse the repository at this point in the history
fix: faucet not funding full amount
  • Loading branch information
joroshiba authored Jul 31, 2024
2 parents 1d241ee + 234b1f9 commit 2d54fe0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
- "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+"
pull_request:
branches:
- "main"

jobs:
build-and-publish-latest:
Expand Down
3 changes: 2 additions & 1 deletion internal/chain/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ func (b *TxBuild) Transfer(ctx context.Context, to string, value *big.Int) (byte
}

// convertToUint128 converts a string to a Uint128 protobuf
func convertToUint128(numStr *big.Int) (*primproto.Uint128, error) {
func convertToUint128(num *big.Int) (*primproto.Uint128, error) {
numStr := new(big.Int).Set(num)

// check if the number is negative or overflows Uint128
if numStr.Sign() < 0 {
Expand Down
4 changes: 2 additions & 2 deletions internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (s *Server) consumeQueue() {
defer s.mutex.Unlock()
for len(s.queue) != 0 {
address := <-s.queue
txHash, err := s.Transfer(context.Background(), address, s.cfg.payout)
txHash, err := s.Transfer(context.Background(), address, s.cfg.payoutNano)
if err != nil {
log.WithError(err).Error("Failed to handle transaction in the queue")
} else {
Expand Down Expand Up @@ -102,7 +102,7 @@ func (s *Server) handleClaim() http.HandlerFunc {

ctx, cancel := context.WithTimeout(r.Context(), 5*time.Second)
defer cancel()
txHash, err := s.Transfer(ctx, address, s.cfg.payout)
txHash, err := s.Transfer(ctx, address, s.cfg.payoutNano)
s.mutex.Unlock()
if err != nil {
log.WithError(err).Error("Failed to send transaction")
Expand Down

0 comments on commit 2d54fe0

Please sign in to comment.