Skip to content

Commit

Permalink
Merge pull request #7 from astriaorg/joroshiba/support-nria
Browse files Browse the repository at this point in the history
chore: update to submit nria amount
  • Loading branch information
joroshiba authored Apr 9, 2024
2 parents c392ded + 7953bef commit 97dcc80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions internal/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type Config struct {
httpPort int
interval int
payout *big.Int
payoutNano *big.Int
proxyCount int
queueCap int
}
Expand All @@ -19,6 +20,7 @@ func NewConfig(network string, httpPort, interval, payout, proxyCount, queueCap
httpPort: httpPort,
interval: interval,
payout: big.NewInt(int64(payout)),
payoutNano: big.NewInt(int64(payout * 1e9)),
proxyCount: proxyCount,
queueCap: queueCap,
}
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 97dcc80

Please sign in to comment.