-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: Query staking Pool and Params #2099
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2099 +/- ##
========================================
Coverage 63.82% 63.82%
========================================
Files 113 113
Lines 6684 6684
========================================
Hits 4266 4266
Misses 2135 2135
Partials 283 283 |
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 on LCD tests. Haven't looked at the rest of the code.
client/lcd/lcd_test.go
Outdated
@@ -353,6 +353,35 @@ func TestTxs(t *testing.T) { | |||
require.Equal(t, resultTx.Height, indexedTxs[0].Height) | |||
} | |||
|
|||
func TestPoolQuery(t *testing.T) { | |||
_, password := "test", "1234567890" |
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.
Can you make the first parameter a variable, and use it in the subsequent line.
client/lcd/lcd_test.go
Outdated
} | ||
|
||
func TestParamsQuery(t *testing.T) { | ||
_, password := "test", "1234567890" |
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.
Same as above
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.
will merge both into one test
client/lcd/lcd_test.go
Outdated
defer cleanup() | ||
|
||
res, body := Request(t, port, "GET", "/stake/pool", nil) | ||
require.Equal(t, http.StatusOK, res.StatusCode, body) |
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.
Let's do some check on the body? Currently this test just ensures that the endpoint doesn't error, not that it actually does anything.
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.
@ValarDragon I'm trying to compare the initial pool with the returned one
expected: types.Pool{
LooseTokens:1000000000000,
BondedTokens:0,
InflationLastTime:time.Time{wall:0x0, ext:62135596800, loc:(*time.Location)(0x22aad00)},
Inflation:700000000,
DateLastCommissionReset:0,
PrevBondedShares:0}
actual : types.Pool{
LooseTokens:1500019965200,
BondedTokens:1000000000000,
InflationLastTime:time.Time{wall:0x1d6c1165, ext:63670381882, loc:(*time.Location)(nil)},
Inflation:700059763,
DateLastCommissionReset:0,
PrevBondedShares:0}
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.
@ValarDragon could you help me figuring out where LooseTokens
, BondedTokens
and Inflation
are updated once you initialize LCD?
Please rebase on develop. |
addressed. Tests for Pool
are working now
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.
utACK
Closes #2011, #2012
API docs for LCD endpoints are being updated in #2066
docs/
)PENDING.md
that include links to the relevant issue or PR that most accurately describes the change.cmd/gaia
andexamples/
For Admin Use: