Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
expertdicer committed Jan 15, 2024
1 parent 5d4b21d commit a1a075d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 23 deletions.
5 changes: 2 additions & 3 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ import (
"github.com/classic-terra/core/v2/app/keepers"
terraappparams "github.com/classic-terra/core/v2/app/params"

ibckeeper "github.com/cosmos/ibc-go/v6/modules/core/keeper"
capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper"

ibckeeper "github.com/cosmos/ibc-go/v6/modules/core/keeper"

// upgrades
"github.com/classic-terra/core/v2/app/upgrades"
Expand Down Expand Up @@ -442,4 +441,4 @@ func (app *TerraApp) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper {

func (app *TerraApp) GetTxConfig() client.TxConfig {
return MakeEncodingConfig().TxConfig
}
}
26 changes: 13 additions & 13 deletions app/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ import (
tmtypes "github.com/tendermint/tendermint/types"
)

var defaultGenesisBz []byte

func getDefaultGenesisStateBytes() []byte {
if len(defaultGenesisBz) == 0 {
genesisState := NewDefaultGenesisState()
stateBytes, err := json.MarshalIndent(genesisState, "", " ")
if err != nil {
panic(err)
}
defaultGenesisBz = stateBytes
}
return defaultGenesisBz
}
// var defaultGenesisBz []byte

// func getDefaultGenesisStateBytes() []byte {
// if len(defaultGenesisBz) == 0 {
// genesisState := NewDefaultGenesisState()
// stateBytes, err := json.MarshalIndent(genesisState, "", " ")
// if err != nil {
// panic(err)
// }
// defaultGenesisBz = stateBytes
// }
// return defaultGenesisBz
// }

// interBlockCacheOpt returns a BaseApp option function that sets the persistent
// inter-block write-through cache.
Expand Down
9 changes: 3 additions & 6 deletions tests/ibc-hooks/ibc_middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ func (suite *HooksTestSuite) receivePacketWithSequence(receiver, memo string, pr

// recv in chain a
res, err := suite.path.EndpointA.RecvPacketWithResult(packet)
suite.Require().NoError(err)

// get the ack from the chain a's response
ack, err := ibctesting.ParseAckFromEvents(res.GetEvents())
Expand Down Expand Up @@ -306,7 +307,7 @@ func (suite *HooksTestSuite) TestPacketsThatShouldBeSkipped() {
} else {
suite.Require().Contains(ackStr, "error", tc.memo)
}
sequence += 1
sequence++
}
}

Expand Down Expand Up @@ -458,7 +459,6 @@ func (suite *HooksTestSuite) TestAcks() {
&suite.Suite, addr,
[]byte(fmt.Sprintf(`{"get_count": {"addr": "%s"}}`, addr)))
suite.Require().Equal(`{"count":2}`, state)

}

func (suite *HooksTestSuite) TestTimeouts() {
Expand Down Expand Up @@ -491,7 +491,6 @@ func (suite *HooksTestSuite) TestTimeouts() {
&suite.Suite, addr,
[]byte(fmt.Sprintf(`{"get_count": {"addr": "%s"}}`, addr)))
suite.Require().Equal(`{"count":10}`, state)

}

func (suite *HooksTestSuite) TestSendWithoutMemo() {
Expand Down Expand Up @@ -530,15 +529,13 @@ func (suite *HooksTestSuite) SetupIBCRouteOnChainB(swaprouterAddr, owner sdk.Acc
suite.Require().NoError(err)
err = suite.path.EndpointB.UpdateClient()
suite.Require().NoError(err)

}

func (suite *HooksTestSuite) GetChain(name Chain) *terraibctesting.TestChain {
if name == ChainA {
return suite.chainA
} else {
return suite.chainB
}
return suite.chainB
}

// MustExtractDenomFromPacketOnRecv takes a packet with a valid ICS20 token data in the Data field and returns the
Expand Down
2 changes: 1 addition & 1 deletion tests/terraibctesting/wasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (chain *TestChain) QueryContract(suite *suite.Suite, contract sdk.AccAddres
return string(state)
}

func (chain *TestChain) QueryContractJson(suite *suite.Suite, contract sdk.AccAddress, key []byte) gjson.Result {
func (chain *TestChain) QueryContractJSON(suite *suite.Suite, contract sdk.AccAddress, key []byte) gjson.Result {
terraApp := chain.GetTerraApp()
state, err := terraApp.WasmKeeper.QuerySmart(chain.GetContext(), contract, key)
suite.Require().NoError(err)
Expand Down

0 comments on commit a1a075d

Please sign in to comment.