Skip to content

Commit

Permalink
Merge branch 'main' into feature/pna-headers
Browse files Browse the repository at this point in the history
  • Loading branch information
nullun committed Sep 17, 2024
2 parents dc9f5ff + 249016c commit be49453
Show file tree
Hide file tree
Showing 20 changed files with 396 additions and 662 deletions.
188 changes: 0 additions & 188 deletions accounting/rewind.go

This file was deleted.

79 changes: 0 additions & 79 deletions accounting/rewind_test.go

This file was deleted.

18 changes: 9 additions & 9 deletions api/converter_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,17 +645,17 @@ func (si *ServerImplementation) assetParamsToAssetQuery(params generated.SearchF
return idb.AssetsQuery{}, errors.New(errUnableToParseAddress)
}

var assetGreaterThan uint64 = 0
var assetGreaterThan *uint64
if params.Next != nil {
agt, err := strconv.ParseUint(*params.Next, 10, 64)
if err != nil {
return idb.AssetsQuery{}, fmt.Errorf("%s: %v", errUnableToParseNext, err)
}
assetGreaterThan = agt
assetGreaterThan = &agt
}

query := idb.AssetsQuery{
AssetID: uintOrDefault(params.AssetId),
AssetID: params.AssetId,
AssetIDGreaterThan: assetGreaterThan,
Creator: creator,
Name: strOrDefault(params.Name),
Expand All @@ -674,17 +674,17 @@ func (si *ServerImplementation) appParamsToApplicationQuery(params generated.Sea
return idb.ApplicationQuery{}, errors.New(errUnableToParseAddress)
}

var appGreaterThan uint64 = 0
var appGreaterThan *uint64
if params.Next != nil {
agt, err := strconv.ParseUint(*params.Next, 10, 64)
if err != nil {
return idb.ApplicationQuery{}, fmt.Errorf("%s: %v", errUnableToParseNext, err)
}
appGreaterThan = agt
appGreaterThan = &agt
}

return idb.ApplicationQuery{
ApplicationID: uintOrDefault(params.ApplicationId),
ApplicationID: params.ApplicationId,
ApplicationIDGreaterThan: appGreaterThan,
Address: addr,
IncludeDeleted: boolOrDefault(params.IncludeAll),
Expand All @@ -698,8 +698,8 @@ func (si *ServerImplementation) transactionParamsToTransactionFilter(params gene
// Integer
filter.MaxRound = uintOrDefault(params.MaxRound)
filter.MinRound = uintOrDefault(params.MinRound)
filter.AssetID = uintOrDefault(params.AssetId)
filter.ApplicationID = uintOrDefault(params.ApplicationId)
filter.AssetID = params.AssetId
filter.ApplicationID = params.ApplicationId
filter.Limit = min(uintOrDefaultValue(params.Limit, si.opts.DefaultTransactionsLimit), si.opts.MaxTransactionsLimit)
filter.Round = params.Round

Expand Down Expand Up @@ -730,7 +730,7 @@ func (si *ServerImplementation) transactionParamsToTransactionFilter(params gene
filter.RekeyTo = params.RekeyTo

// filter Algos or Asset but not both.
if filter.AssetID != 0 || filter.TypeEnum == idb.TypeEnumAssetTransfer {
if filter.AssetID != nil || filter.TypeEnum == idb.TypeEnumAssetTransfer {
filter.AssetAmountLT = params.CurrencyLessThan
filter.AssetAmountGT = params.CurrencyGreaterThan
} else {
Expand Down
3 changes: 1 addition & 2 deletions api/error_messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ const (
errMultipleApplications = "multiple applications found for this id, please contact us, this shouldn't happen"
ErrMultipleBoxes = "multiple application boxes found for this app id and box name, please contact us, this shouldn't happen"
ErrFailedLookingUpBoxes = "failed while looking up application boxes"
errMultiAcctRewind = "multiple accounts rewind is not supported by this server"
errRewindingAccount = "error while rewinding account"
errRewindingAccountNotSupported = "rewinding account is no longer supported, please remove the `round=` query parameter and try again"
errLookingUpBlockForRound = "error while looking up block for round"
errTransactionSearch = "error while searching for transaction"
errZeroAddressCloseRemainderToRole = "searching transactions by zero address with close address role is not supported"
Expand Down
Loading

0 comments on commit be49453

Please sign in to comment.