diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 68d7f34..e301d0e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -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: diff --git a/internal/chain/transaction.go b/internal/chain/transaction.go index 9f66070..ea02302 100644 --- a/internal/chain/transaction.go +++ b/internal/chain/transaction.go @@ -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 { diff --git a/internal/server/server.go b/internal/server/server.go index 72a7830..0fd0daa 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -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 { @@ -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")