Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion auction/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"errors"
"fmt"
"math"
"sync"

"github.com/algorand/go-deadlock"
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion cmd/auctionminion/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"flag"
"fmt"
"io/ioutil"
"math"
"net/url"
"os"

Expand Down Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions daemon/algod/api/client/restClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion test/e2e-go/restAPI/restClient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down