diff --git a/auction/tracker.go b/auction/tracker.go index effc445a3e..a71101abd4 100644 --- a/auction/tracker.go +++ b/auction/tracker.go @@ -20,6 +20,7 @@ import ( "context" "errors" "fmt" + "math" "sync" "github.com/algorand/go-deadlock" @@ -289,7 +290,7 @@ func (am *Tracker) LiveUpdateWithContext(ctx context.Context, wg *sync.WaitGroup log.Debugf("Getting transactions for %d-%d", am.LastRound+1, status.LastRound) - transactions, err := rc.TransactionsByAddr(am.AuctionKey.GetChecksumAddress().String(), am.LastRound+1, status.LastRound) + transactions, err := rc.TransactionsByAddr(am.AuctionKey.GetChecksumAddress().String(), am.LastRound+1, status.LastRound, math.MaxUint64) if err != nil { log.Error(err) fmt.Println(err) diff --git a/cmd/auctionminion/main.go b/cmd/auctionminion/main.go index 941fe315a3..e8128c9db3 100644 --- a/cmd/auctionminion/main.go +++ b/cmd/auctionminion/main.go @@ -21,6 +21,7 @@ import ( "flag" "fmt" "io/ioutil" + "math" "net/url" "os" @@ -143,7 +144,7 @@ func main() { fmt.Printf("Checking round %d..\n", curRound) } - txns, err := restClient.TransactionsByAddr(auctionChecksumAddr.String(), curRound, curRound) + txns, err := restClient.TransactionsByAddr(auctionChecksumAddr.String(), curRound, curRound, math.MaxUint64) if err != nil { fmt.Fprintf(os.Stderr, "Cannot fetch transactions from %d: %v\n", curRound, err) os.Exit(1) diff --git a/daemon/algod/api/client/restClient.go b/daemon/algod/api/client/restClient.go index 12222b0b16..ede9be3e78 100644 --- a/daemon/algod/api/client/restClient.go +++ b/daemon/algod/api/client/restClient.go @@ -210,12 +210,13 @@ func (client RestClient) LedgerSupply() (response models.Supply, err error) { type transactionsByAddrParams struct { FirstRound uint64 `url:"firstRound"` LastRound uint64 `url:"lastRound"` + Max uint64 `url:"max"` } // TransactionsByAddr returns all transactions for a PK [addr] in the [first, // last] rounds range. -func (client RestClient) TransactionsByAddr(addr string, first, last uint64) (response models.TransactionList, err error) { - err = client.get(&response, fmt.Sprintf("/account/%s/transactions", addr), transactionsByAddrParams{first, last}) +func (client RestClient) TransactionsByAddr(addr string, first, last, max uint64) (response models.TransactionList, err error) { + err = client.get(&response, fmt.Sprintf("/account/%s/transactions", addr), transactionsByAddrParams{first, last, max}) return } diff --git a/test/e2e-go/restAPI/restClient_test.go b/test/e2e-go/restAPI/restClient_test.go index 4ee5a479aa..39ac93b0c4 100644 --- a/test/e2e-go/restAPI/restClient_test.go +++ b/test/e2e-go/restAPI/restClient_test.go @@ -211,7 +211,7 @@ func TestTransactionsByAddr(t *testing.T) { restClient, err := localFixture.NC.AlgodClient() require.NoError(t, err) - res, err := restClient.TransactionsByAddr(toAddress, 0, rnd.LastRound) + res, err := restClient.TransactionsByAddr(toAddress, 0, rnd.LastRound, 100) require.NoError(t, err) require.Equal(t, 1, len(res.Transactions))