Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasmatt committed Nov 2, 2023
1 parent 41c9231 commit 62fcc8d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions x/common/testutil/cli/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ import (
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"google.golang.org/grpc"

perpV2types "github.com/NibiruChain/nibiru/x/perp/v2/types"

"github.com/NibiruChain/nibiru/x/common/denoms"

"github.com/NibiruChain/nibiru/app"
Expand Down Expand Up @@ -174,6 +176,7 @@ func BuildNetworkConfig(appGenesis app.GenesisState) Config {
BondedTokens: sdk.TokensFromConsensusPower(100, sdk.DefaultPowerReduction),
StartingTokens: sdk.NewCoins(
sdk.NewCoin(denoms.NUSD, sdk.TokensFromConsensusPower(1e12, sdk.DefaultPowerReduction)),
sdk.NewCoin(perpV2types.DefaultTestingCollateralNotForProd.GetTFDenom(), sdk.TokensFromConsensusPower(1e12, sdk.DefaultPowerReduction)),
sdk.NewCoin(denoms.NIBI, sdk.TokensFromConsensusPower(1e12, sdk.DefaultPowerReduction)),
sdk.NewCoin(denoms.USDC, sdk.TokensFromConsensusPower(1e12, sdk.DefaultPowerReduction)),
),
Expand Down
4 changes: 2 additions & 2 deletions x/perp/v2/integration/action/market.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ type setCollateral struct {
}

func (c setCollateral) Do(app *app.NibiruApp, ctx sdk.Context) (sdk.Context, error, bool) {
app.PerpKeeperV2.Admin.UpdateCollateral(ctx, c.Collateral.Denom, c.Collateral.ContractAddress)
return ctx, nil, true
err := app.PerpKeeperV2.Admin.UpdateCollateral(ctx, c.Collateral.Denom, c.Collateral.ContractAddress)
return ctx, err, true
}

func SetCollateral(collateral types.Collateral) action.Action {
Expand Down
5 changes: 4 additions & 1 deletion x/perp/v2/module/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState)
}

if genState.Collateral != nil {
k.Admin.UpdateCollateral(ctx, *&genState.Collateral.Denom, *&genState.Collateral.ContractAddress)
err := k.Admin.UpdateCollateral(ctx, *&genState.Collateral.Denom, *&genState.Collateral.ContractAddress)
if err != nil {
panic(err)
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion x/perp/v2/module/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func RunTestGenesis(t *testing.T, tc TestCase) {
pair := asset.Registry.Pair(denoms.BTC, denoms.NUSD)

// create some params
app.PerpKeeperV2.Admin.UpdateCollateral(ctx, "unusd", types.DefaultTestingCollateralNotForProd.ContractAddress)
require.NoError(t, app.PerpKeeperV2.Admin.UpdateCollateral(ctx, "unusd", types.DefaultTestingCollateralNotForProd.ContractAddress))
app.PerpKeeperV2.SaveMarket(ctx, *mock.TestMarket())
app.PerpKeeperV2.MarketLastVersion.Insert(ctx, pair, types.MarketLastVersion{Version: 1})
app.PerpKeeperV2.SaveAMM(ctx, *mock.TestAMMDefault())
Expand Down

0 comments on commit 62fcc8d

Please sign in to comment.