Skip to content

Commit

Permalink
Merge PR CosmWasm#53: Update latest SDK version: Events Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderbez committed Jun 26, 2019
1 parent bd72311 commit 0432ac5
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 61 deletions.
44 changes: 23 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -391,23 +391,26 @@ jobs:
- store_artifacts:
path: /go/src/github.com/cosmos/gaia/gaia-windows-res.yml

contract_tests:
<<: *linux_defaults
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
- setup_remote_docker:
docker_layer_caching: true
- run:
name: Get Node.js and test REST implementation against swagger documentation at https://cosmos.network/rpc/
command: |
go get github.com/snikch/goodman/cmd/goodman
make build
make build-contract-tests-hooks
make setup-contract-tests-data
export PATH=~/.local/bin:$PATH
./contrib/get_node.sh && make contract-tests
# FIXME: The `setup-contract-tests-data` make target is broken as it completely
# overrides the .gaiad directory.
#
# contract_tests:
# <<: *linux_defaults
# steps:
# - attach_workspace:
# at: /tmp/workspace
# - checkout
# - setup_remote_docker:
# docker_layer_caching: true
# - run:
# name: Get Node.js and test REST implementation against swagger documentation at https://cosmos.network/rpc/
# command: |
# go get github.com/snikch/goodman/cmd/goodman
# make build
# make build-contract-tests-hooks
# make setup-contract-tests-data
# export PATH=~/.local/bin:$PATH
# ./contrib/get_node.sh && make contract-tests

workflows:
version: 2
Expand Down Expand Up @@ -487,7 +490,6 @@ workflows:
- master
requires:
- setup_dependencies
- contract_tests:
requires:
- setup_dependencies

# - contract_tests:
# requires:
# - setup_dependencies
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func NewGaiaApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest b
genutil.NewAppModule(app.accountKeeper, app.stakingKeeper, app.BaseApp.DeliverTx),
auth.NewAppModule(app.accountKeeper, app.feeCollectionKeeper),
bank.NewAppModule(app.bankKeeper, app.accountKeeper),
crisis.NewAppModule(app.crisisKeeper, app.Logger()),
crisis.NewAppModule(app.crisisKeeper),
distr.NewAppModule(app.distrKeeper),
gov.NewAppModule(app.govKeeper),
mint.NewAppModule(app.mintKeeper),
Expand Down
2 changes: 1 addition & 1 deletion app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (app *GaiaApp) prepForZeroHeightGenesis(ctx sdk.Context, jailWhiteList []st
}

/* Just to be safe, assert the invariants on current state. */
app.crisisKeeper.AssertInvariants(ctx, app.Logger())
app.crisisKeeper.AssertInvariants(ctx)

/* Handle fee distribution state. */

Expand Down
26 changes: 13 additions & 13 deletions cli_test/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ func TestGaiaCLISubmitProposal(t *testing.T) {
tests.WaitForNextNBlocksTM(1, f.Port)

// Ensure transaction tags can be queried
searchResult := f.QueryTxs(1, 50, "action:submit_proposal", fmt.Sprintf("sender:%s", fooAddr))
searchResult := f.QueryTxs(1, 50, "message.action:submit_proposal", fmt.Sprintf("message.sender:%s", fooAddr))
require.Len(t, searchResult.Txs, 1)

// Ensure deposit was deducted
Expand Down Expand Up @@ -527,7 +527,7 @@ func TestGaiaCLISubmitProposal(t *testing.T) {
require.Equal(t, proposalTokens.Add(depositTokens), deposit.Amount.AmountOf(denom))

// Ensure tags are set on the transaction
searchResult = f.QueryTxs(1, 50, "action:deposit", fmt.Sprintf("sender:%s", fooAddr))
searchResult = f.QueryTxs(1, 50, "message.action:deposit", fmt.Sprintf("message.sender:%s", fooAddr))
require.Len(t, searchResult.Txs, 1)

// Ensure account has expected amount of funds
Expand Down Expand Up @@ -564,7 +564,7 @@ func TestGaiaCLISubmitProposal(t *testing.T) {
require.Equal(t, gov.OptionYes, votes[0].Option)

// Ensure tags are applied to voting transaction properly
searchResult = f.QueryTxs(1, 50, "action:vote", fmt.Sprintf("sender:%s", fooAddr))
searchResult = f.QueryTxs(1, 50, "message.action:vote", fmt.Sprintf("message.sender:%s", fooAddr))
require.Len(t, searchResult.Txs, 1)

// Ensure no proposals in deposit period
Expand Down Expand Up @@ -626,7 +626,7 @@ func TestGaiaCLISubmitParamChangeProposal(t *testing.T) {
tests.WaitForNextNBlocksTM(1, f.Port)

// ensure transaction tags can be queried
txsPage := f.QueryTxs(1, 50, "action:submit_proposal", fmt.Sprintf("sender:%s", fooAddr))
txsPage := f.QueryTxs(1, 50, "message.action:submit_proposal", fmt.Sprintf("message.sender:%s", fooAddr))
require.Len(t, txsPage.Txs, 1)

// ensure deposit was deducted
Expand Down Expand Up @@ -710,7 +710,7 @@ func TestGaiaCLISubmitCommunityPoolSpendProposal(t *testing.T) {
tests.WaitForNextNBlocksTM(1, f.Port)

// ensure transaction tags can be queried
txsPage := f.QueryTxs(1, 50, "action:submit_proposal", fmt.Sprintf("sender:%s", fooAddr))
txsPage := f.QueryTxs(1, 50, "message.action:submit_proposal", fmt.Sprintf("message.sender:%s", fooAddr))
require.Len(t, txsPage.Txs, 1)

// ensure deposit was deducted
Expand Down Expand Up @@ -755,33 +755,33 @@ func TestGaiaCLIQueryTxPagination(t *testing.T) {
}

// perPage = 15, 2 pages
txsPage1 := f.QueryTxs(1, 15, fmt.Sprintf("sender:%s", fooAddr))
txsPage1 := f.QueryTxs(1, 15, fmt.Sprintf("message.sender:%s", fooAddr))
require.Len(t, txsPage1.Txs, 15)
require.Equal(t, txsPage1.Count, 15)
txsPage2 := f.QueryTxs(2, 15, fmt.Sprintf("sender:%s", fooAddr))
txsPage2 := f.QueryTxs(2, 15, fmt.Sprintf("message.sender:%s", fooAddr))
require.Len(t, txsPage2.Txs, 15)
require.NotEqual(t, txsPage1.Txs, txsPage2.Txs)
txsPage3 := f.QueryTxs(3, 15, fmt.Sprintf("sender:%s", fooAddr))
txsPage3 := f.QueryTxs(3, 15, fmt.Sprintf("message.sender:%s", fooAddr))
require.Len(t, txsPage3.Txs, 15)
require.Equal(t, txsPage2.Txs, txsPage3.Txs)

// perPage = 16, 2 pages
txsPage1 = f.QueryTxs(1, 16, fmt.Sprintf("sender:%s", fooAddr))
txsPage1 = f.QueryTxs(1, 16, fmt.Sprintf("message.sender:%s", fooAddr))
require.Len(t, txsPage1.Txs, 16)
txsPage2 = f.QueryTxs(2, 16, fmt.Sprintf("sender:%s", fooAddr))
txsPage2 = f.QueryTxs(2, 16, fmt.Sprintf("message.sender:%s", fooAddr))
require.Len(t, txsPage2.Txs, 14)
require.NotEqual(t, txsPage1.Txs, txsPage2.Txs)

// perPage = 50
txsPageFull := f.QueryTxs(1, 50, fmt.Sprintf("sender:%s", fooAddr))
txsPageFull := f.QueryTxs(1, 50, fmt.Sprintf("message.sender:%s", fooAddr))
require.Len(t, txsPageFull.Txs, 30)
require.Equal(t, txsPageFull.Txs, append(txsPage1.Txs, txsPage2.Txs...))

// perPage = 0
f.QueryTxsInvalid(errors.New("ERROR: page must greater than 0"), 0, 50, fmt.Sprintf("sender:%s", fooAddr))
f.QueryTxsInvalid(errors.New("ERROR: page must greater than 0"), 0, 50, fmt.Sprintf("message.sender:%s", fooAddr))

// limit = 0
f.QueryTxsInvalid(errors.New("ERROR: limit must greater than 0"), 1, 0, fmt.Sprintf("sender:%s", fooAddr))
f.QueryTxsInvalid(errors.New("ERROR: limit must greater than 0"), 1, 0, fmt.Sprintf("message.sender:%s", fooAddr))

// Cleanup testing directories
f.Cleanup()
Expand Down
3 changes: 1 addition & 2 deletions cmd/gaiad/replay.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ func replayTxs(rootDir string) error {

// Create executor
fmt.Fprintln(os.Stderr, "Creating block executor")
blockExec := tmsm.NewBlockExecutor(tmDB, ctx.Logger, proxyApp.Consensus(),
tmsm.MockMempool{}, tmsm.MockEvidencePool{})
blockExec := tmsm.NewBlockExecutor(tmDB, ctx.Logger, proxyApp.Consensus(), nil, tmsm.MockEvidencePool{})

// Create block store
fmt.Fprintln(os.Stderr, "Creating block store")
Expand Down
1 change: 1 addition & 0 deletions cmd/gaiad/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ func InitTestnet(cmd *cobra.Command, config *tmconfig.Config, cdc *codec.Codec,
gentxsDir := filepath.Join(outputDir, "gentxs")

config.SetRoot(nodeDir)
config.RPC.ListenAddress = "tcp://0.0.0.0:26657"

if err := os.MkdirAll(filepath.Join(nodeDir, "config"), nodeDirPerm); err != nil {
_ = os.RemoveAll(outputDir)
Expand Down
2 changes: 1 addition & 1 deletion contrib/devtools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ $(CLOG):
$(call go_install,alessio,clog,1)

$(RUNSIM):
go get github.com/cosmos/cosmos-sdk/contrib/runsim@v0.28.2-0.20190622092459-7b5e6cee0787
go get github.com/cosmos/cosmos-sdk/contrib/runsim@v0.28.2-0.20190626164114-c898dac6a9fc
go install -mod=readonly github.com/cosmos/cosmos-sdk/contrib/runsim

tools-clean:
Expand Down
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ go 1.12

require (
github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c // indirect
github.com/cosmos/cosmos-sdk v0.28.2-0.20190622092459-7b5e6cee0787
github.com/cosmos/cosmos-sdk v0.28.2-0.20190626164114-c898dac6a9fc
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d // indirect
github.com/google/gofuzz v1.0.0 // indirect
github.com/gorilla/mux v1.7.2 // indirect
github.com/magiconair/properties v1.8.1 // indirect
github.com/mattn/go-isatty v0.0.8 // indirect
Expand All @@ -27,7 +26,7 @@ require (
github.com/stretchr/testify v1.3.0
github.com/syndtr/goleveldb v1.0.0 // indirect
github.com/tendermint/go-amino v0.15.0
github.com/tendermint/tendermint v0.31.5
github.com/tendermint/tendermint v0.32.0
golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f // indirect
golang.org/x/sys v0.0.0-20190527104216-9cd6430ef91e // indirect
golang.org/x/text v0.3.2 // indirect
Expand Down
Loading

0 comments on commit 0432ac5

Please sign in to comment.