-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
R4R: Support query txs' TotalCount in GET /txs #4214
R4R: Support query txs' TotalCount in GET /txs #4214
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments only, otherwise LGTM
Codecov Report
@@ Coverage Diff @@
## master #4214 +/- ##
==========================================
- Coverage 60.16% 60.13% -0.03%
==========================================
Files 212 212
Lines 15188 15197 +9
==========================================
+ Hits 9138 9139 +1
- Misses 5421 5429 +8
Partials 629 629 |
Codecov Report
@@ Coverage Diff @@
## master #4214 +/- ##
==========================================
- Coverage 59.14% 59.12% -0.02%
==========================================
Files 217 217
Lines 14587 14595 +8
==========================================
+ Hits 8627 8629 +2
- Misses 5322 5328 +6
Partials 638 638 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to mention that we also need to update the documentation (swagger and the gaiacli docs)
Sorry, I forgot it and had updated swagger. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK, Thanks !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor nit, but otherwise LGTM.
@@ -249,6 +250,27 @@ func (r TxResponse) Empty() bool { | |||
return r.TxHash == "" && r.Logs == nil | |||
} | |||
|
|||
// SearchTxsResult defines a structure for querying txs pageable | |||
type SearchTxsResult struct { | |||
TotalCount int `json:"total_count"` // Count of all txs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to returned with every transaction search query? Should this be it's own query?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think any query which does not return all items one time should be pageable. This is friendly to the user. @jackzampolin
it seems the tests are failing now |
Branch |
This should do it: #4264 |
@yangyanqing please rebase again |
Co-Authored-By: yangyanqing <[email protected]>
Co-Authored-By: yangyanqing <[email protected]>
Co-Authored-By: yangyanqing <[email protected]>
It's ok on my local workspace, but still fail on circle. I have remove ➜ cosmos-sdk git:(frank/3942-support-TotalCount-in-GET-txs-master) ✗ make test_cli
go build -mod=readonly -tags "netgo ledger" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=gaia -X github.com/cosmos/cosmos-sdk/version.Version=0.34.0-hashgard-84-g16dd2f533 -X github.com/cosmos/cosmos-sdk/version.Commit=16dd2f533015a039b703ca44b7146a693e4baec4 -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo ledger" -X github.com/cosmos/cosmos-sdk/version.GoSumHash=c4e937a993d3a6f251c77a73a959408b907c393098cc05e3ae5abb49d0a50aa7' -o build/gaiad ./cmd/gaia/cmd/gaiad
go build -mod=readonly -tags "netgo ledger" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=gaia -X github.com/cosmos/cosmos-sdk/version.Version=0.34.0-hashgard-84-g16dd2f533 -X github.com/cosmos/cosmos-sdk/version.Commit=16dd2f533015a039b703ca44b7146a693e4baec4 -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo ledger" -X github.com/cosmos/cosmos-sdk/version.GoSumHash=c4e937a993d3a6f251c77a73a959408b907c393098cc05e3ae5abb49d0a50aa7' -o build/gaiacli ./cmd/gaia/cmd/gaiacli
go build -mod=readonly -tags "netgo ledger" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=gaia -X github.com/cosmos/cosmos-sdk/version.Version=0.34.0-hashgard-84-g16dd2f533 -X github.com/cosmos/cosmos-sdk/version.Commit=16dd2f533015a039b703ca44b7146a693e4baec4 -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo ledger" -X github.com/cosmos/cosmos-sdk/version.GoSumHash=c4e937a993d3a6f251c77a73a959408b907c393098cc05e3ae5abb49d0a50aa7' -o build/gaiareplay ./cmd/gaia/cmd/gaiareplay
ok github.com/cosmos/cosmos-sdk/cmd/gaia/cli_test 181.706s
➜ cosmos-sdk git:(frank/3942-support-TotalCount-in-GET-txs-master) ✗ make test_sim_gaia_nondeterminism
......
Selected randomly generated distribution parameters:
{FeePool:{CommunityPool:} CommunityTax:0.200000000000000000 BaseProposerReward:0.110000000000000000 BonusProposerReward:0.180000000000000000 WithdrawAddrEnabled:false DelegatorWithdrawInfos:[] PreviousProposer: OutstandingRewards:[] ValidatorAccumulatedCommissions:[] ValidatorHistoricalRewards:[] ValidatorCurrentRewards:[] DelegatorStartingInfos:[] ValidatorSlashEvents:[]}
Simulating... block 50/50, operation 0/0. . .
Simulation complete; Final height (blocks): 51, final time (seconds): 2410-01-12 09:02:40 +0800 CST, operations ran: 2867
Event statistics:
/no-operation/failure => 184
auth/deduct_fee/failure => 1
auth/deduct_fee/ok => 17
bank/multisend/failure => 4
bank/multisend/ok => 26
bank/send/failure => 20
bank/send/ok => 335
beginblock/evidence => 9
beginblock/signing/missed => 3767
beginblock/signing/signed => 3526
distr/set_withdraw_address/failure => 163
distr/withdraw_delegator_reward/failure => 146
distr/withdraw_delegator_reward/ok => 4
distr/withdraw_validator_commission/failure => 151
endblock/validatorupdates/added => 49
endblock/validatorupdates/kicked => 49
endblock/validatorupdates/updated => 342
gov/deposit/failure => 306
gov/deposit/ok => 16
gov/submit_proposal/failure => 3
gov/submit_proposal/ok => 33
slashing/unjail/failure => 335
staking/begin_redelegate/failure => 250
staking/begin_redelegate/ok => 2
staking/create_validator/failure => 272
staking/delegate/failure => 159
staking/delegate/ok => 419
staking/edit_validator/failure => 1
staking/edit_validator/ok => 20
--- PASS: TestAppStateDeterminism (164.59s)
PASS
ok github.com/cosmos/cosmos-sdk/cmd/gaia/app 164.648s |
It's clear. @fedekunze @alessio |
close: #3942
replace: #3995
docs/
)sdkch add [section] [stanza] [message]
Files changed
in the github PR explorerFor Admin Use: