Skip to content

Commit

Permalink
Merge PR cosmos#4011: Mint/Inflation Querier, LCD and CLI
Browse files Browse the repository at this point in the history
* A few godoc updates

* More minor tweaks and reformatting

* Implement initial minting querier

* Implement stringer interface for minting params

* Minor cleanup

* Add minting CLI commands

* Implement inflation query command

* Implement annual provisions query and CLI command

* Update x/mint/client/module_client.go

Co-Authored-By: alexanderbez <[email protected]>

* Update x/mint/client/module_client.go

Co-Authored-By: alexanderbez <[email protected]>

* Update x/mint/client/module_client.go

Co-Authored-By: alexanderbez <[email protected]>

* Update x/mint/querier.go

Co-Authored-By: alexanderbez <[email protected]>

* Add minting REST client routes/handlers

* Fix build issues

* Implement querier unit tests

* Update gaiacli docs

* Implement LCD tests

* Update Swagger docs

* Add pending log entry

* add examples

Signed-off-by: Karoly Albert Szabo <[email protected]>

* revert adding examples

Signed-off-by: Karoly Albert Szabo <[email protected]>
  • Loading branch information
alexanderbez authored and jackzampolin committed Apr 1, 2019
1 parent 120e08f commit b95ade9
Show file tree
Hide file tree
Showing 17 changed files with 635 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#3886 Implement minting module querier and CLI/REST clients.
28 changes: 28 additions & 0 deletions client/lcd/lcd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"testing"
"time"

"github.com/cosmos/cosmos-sdk/x/mint"

"github.com/stretchr/testify/require"

"github.com/cosmos/cosmos-sdk/client"
Expand Down Expand Up @@ -1005,3 +1007,29 @@ func TestDistributionFlow(t *testing.T) {
resultTx = doWithdrawDelegatorAllRewards(t, port, seed, name1, pw, addr, fees)
require.Equal(t, uint32(0), resultTx.Code)
}

func TestMintingQueries(t *testing.T) {
kb, err := keys.NewKeyBaseFromDir(InitClientHome(t, ""))
require.NoError(t, err)
addr, _ := CreateAddr(t, name1, pw, kb)
cleanup, _, _, port := InitializeTestLCD(t, 1, []sdk.AccAddress{addr}, true)
defer cleanup()

res, body := Request(t, port, "GET", "/minting/parameters", nil)
require.Equal(t, http.StatusOK, res.StatusCode, body)

var params mint.Params
require.NoError(t, cdc.UnmarshalJSON([]byte(body), &params))

res, body = Request(t, port, "GET", "/minting/inflation", nil)
require.Equal(t, http.StatusOK, res.StatusCode, body)

var inflation sdk.Dec
require.NoError(t, cdc.UnmarshalJSON([]byte(body), &inflation))

res, body = Request(t, port, "GET", "/minting/annual-provisions", nil)
require.Equal(t, http.StatusOK, res.StatusCode, body)

var annualProvisions sdk.Dec
require.NoError(t, cdc.UnmarshalJSON([]byte(body), &annualProvisions))
}
Loading

0 comments on commit b95ade9

Please sign in to comment.