Skip to content
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

chore(params): Clean up params for testnet #741

Merged
merged 12 commits into from
Jul 26, 2022
7 changes: 3 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### API Breaking
* [#737](https://github.com/NibiruChain/nibiru/pull/737) - Renamed from property to avoid python name clash


### Documentation

* [#701](https://github.com/NibiruChain/nibiru/pull/701) Add release process guide
Expand All @@ -60,15 +56,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* [#736](https://github.com/NibiruChain/nibiru/pull/736) - Bumps [github.com/spf13/cast](https://github.com/spf13/cast) from 1.4.1 to 1.5.0
* [#735](https://github.com/NibiruChain/nibiru/pull/735) - Bump github.com/spf13/cobra from 1.4.0 to 1.5.0
* [#729](https://github.com/NibiruChain/nibiru/pull/729) - move maintenance margin to the vpool module
* [#741](https://github.com/NibiruChain/nibiru/pull/741) - remove unused code and refactored variable names.

### API Breaking

* [#721](https://github.com/NibiruChain/nibiru/pull/721) - Updated proto property names to adhere to standard snake_casing and added Unlock REST endpoint
* [#724](https://github.com/NibiruChain/nibiru/pull/724) - Add position fields in `ClosePositionResponse`.
* [#737](https://github.com/NibiruChain/nibiru/pull/737) - Renamed from property to avoid python name clash

### State Machine Breaking

* [#733](https://github.com/NibiruChain/nibiru/pull/733) - Bump github.com/cosmos/ibc-go/v3 from 3.0.0 to 3.1.0
* [#741](https://github.com/NibiruChain/nibiru/pull/741) - Rename `epoch_identifier` param to `funding_rate_interval`.

## [v0.10.0](https://github.com/NibiruChain/nibiru/releases/tag/v0.10.0) - 2022-07-18

Expand Down
4 changes: 2 additions & 2 deletions proto/perp/v1/state.proto
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ message Params {
(gogoproto.nullable) = false
];

// specifies the interval on which the fundingPayment is being updated
string epoch_identifier = 7;
// specifies the interval on which the funding rate is updated
string funding_rate_interval = 7;

// amount of time to look back for TWAP calculations
google.protobuf.Duration twap_lookback_window = 8 [
Expand Down
27 changes: 12 additions & 15 deletions x/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,25 @@ import (
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)

var (
DenomGov = "unibi"
DenomColl = "uusdc"
DenomStable = "unusd"
DenomStakeToken = "stake"
DenomTestToken = "test"
DenomAxlBTC = "axlwbtc"
DenomAxlETH = "axlweth"
const (
DenomGov = "unibi"
DenomColl = "uusdc"
DenomStable = "unusd"
DenomBTC = "ubtc"
DenomETH = "ueth"

ModuleName = "common"

TreasuryPoolModuleAccount = "treasury_pool"

PairSeparator = ":"
)

WhitelistedColl = []string{DenomColl}

var (
PairGovStable = AssetPair{Token0: DenomGov, Token1: DenomStable}
PairCollStable = AssetPair{Token0: DenomColl, Token1: DenomStable}
PairTestStable = AssetPair{Token0: DenomTestToken, Token1: DenomStable}
PairBTCStable = AssetPair{Token0: DenomAxlBTC, Token1: DenomStable}
PairETHStable = AssetPair{Token0: DenomAxlETH, Token1: DenomStable}
PairBTCStable = AssetPair{Token0: DenomBTC, Token1: DenomStable}
PairETHStable = AssetPair{Token0: DenomETH, Token1: DenomStable}

ErrInvalidTokenPair = sdkerrors.Register(ModuleName, 1, "invalid token pair")
)
Expand Down Expand Up @@ -94,11 +91,11 @@ func (pair AssetPair) Inverse() AssetPair {
return AssetPair{pair.Token1, pair.Token0}
}

func (pair AssetPair) GetBaseTokenDenom() string {
func (pair AssetPair) BaseDenom() string {
return pair.Token0
}

func (pair AssetPair) GetQuoteTokenDenom() string {
func (pair AssetPair) QuoteDenom() string {
return pair.Token1
}

Expand Down
4 changes: 2 additions & 2 deletions x/common/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ func TestAsset_GetQuoteBaseToken(t *testing.T) {
pair, err := common.NewAssetPair("uatom:unibi")
require.NoError(t, err)

require.Equal(t, "uatom", pair.GetBaseTokenDenom())
require.Equal(t, "unibi", pair.GetQuoteTokenDenom())
require.Equal(t, "uatom", pair.BaseDenom())
require.Equal(t, "unibi", pair.QuoteDenom())
}

func TestAssetPair_Marshaling(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions x/dex/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ func TestSetAndFetchPool(t *testing.T) {
},
PoolAssets: []types.PoolAsset{
{
Token: sdk.NewCoin("validatortoken", sdk.NewInt(1000)),
Token: sdk.NewCoin(common.DenomBTC, sdk.NewInt(1000)),
Weight: sdk.NewInt(1),
},
{
Token: sdk.NewCoin(common.DenomStakeToken, sdk.NewInt(1000)),
Token: sdk.NewCoin(common.DenomStable, sdk.NewInt(1000)),
Weight: sdk.NewInt(1),
},
},
Expand Down
1 change: 0 additions & 1 deletion x/dex/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ func DefaultParams() Params {
common.DenomGov,
common.DenomColl,
common.DenomStable,
common.DenomStakeToken,
},
}
}
Expand Down
36 changes: 18 additions & 18 deletions x/dex/types/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestGetPoolAssetAndIndexHappyPath(t *testing.T) {
{
name: "single asset",
poolAssets: []PoolAsset{
PoolAsset{
{
Token: sdk.NewInt64Coin("foo", 100),
Weight: sdk.NewInt(1),
},
Expand All @@ -33,15 +33,15 @@ func TestGetPoolAssetAndIndexHappyPath(t *testing.T) {
{
name: "middle asset",
poolAssets: []PoolAsset{
PoolAsset{
{
Token: sdk.NewInt64Coin("bar", 100),
Weight: sdk.NewInt(1),
},
PoolAsset{
{
Token: sdk.NewInt64Coin("foo", 100),
Weight: sdk.NewInt(1),
},
PoolAsset{
{
Token: sdk.NewInt64Coin("zee", 100),
Weight: sdk.NewInt(1),
},
Expand All @@ -56,11 +56,11 @@ func TestGetPoolAssetAndIndexHappyPath(t *testing.T) {
{
name: "asset to the left",
poolAssets: []PoolAsset{
PoolAsset{
{
Token: sdk.NewInt64Coin("bar", 100),
Weight: sdk.NewInt(1),
},
PoolAsset{
{
Token: sdk.NewInt64Coin("foo", 200),
Weight: sdk.NewInt(1),
},
Expand Down Expand Up @@ -104,7 +104,7 @@ func TestGetPoolAssetAndIndexErrors(t *testing.T) {
{
name: "empty denom",
poolAssets: []PoolAsset{
PoolAsset{
{
Token: sdk.NewInt64Coin("foo", 100),
Weight: sdk.NewInt(1),
},
Expand All @@ -115,7 +115,7 @@ func TestGetPoolAssetAndIndexErrors(t *testing.T) {
{
name: "denom not found - input denom lexicographically higher",
poolAssets: []PoolAsset{
PoolAsset{
{
Token: sdk.NewInt64Coin("bar", 100),
Weight: sdk.NewInt(1),
},
Expand All @@ -126,7 +126,7 @@ func TestGetPoolAssetAndIndexErrors(t *testing.T) {
{
name: "denom not found - input denom lexicographically lower",
poolAssets: []PoolAsset{
PoolAsset{
{
Token: sdk.NewInt64Coin("foo", 100),
Weight: sdk.NewInt(1),
},
Expand Down Expand Up @@ -157,7 +157,7 @@ func TestPoolBalances(t *testing.T) {
{
name: "happy path single asset",
poolAssets: []PoolAsset{
PoolAsset{
{
Token: sdk.NewInt64Coin("foo", 100),
Weight: sdk.NewInt(1),
},
Expand All @@ -167,11 +167,11 @@ func TestPoolBalances(t *testing.T) {
{
name: "happy path multiple asset",
poolAssets: []PoolAsset{
PoolAsset{
{
Token: sdk.NewInt64Coin("bar", 100),
Weight: sdk.NewInt(1),
},
PoolAsset{
{
Token: sdk.NewInt64Coin("foo", 200),
Weight: sdk.NewInt(1),
},
Expand Down Expand Up @@ -203,13 +203,13 @@ func TestSortPoolAssets(t *testing.T) {
{
name: "single asset",
poolAssets: []PoolAsset{
PoolAsset{
{
Token: sdk.NewInt64Coin("foo", 100),
Weight: sdk.NewInt(1),
},
},
expectedPoolAsset: []PoolAsset{
PoolAsset{
{
Token: sdk.NewInt64Coin("foo", 100),
Weight: sdk.NewInt(1),
},
Expand All @@ -218,21 +218,21 @@ func TestSortPoolAssets(t *testing.T) {
{
name: "happy path multiple asset",
poolAssets: []PoolAsset{
PoolAsset{
{
Token: sdk.NewInt64Coin("foo", 100),
Weight: sdk.NewInt(1),
},
PoolAsset{
{
Token: sdk.NewInt64Coin("bar", 200),
Weight: sdk.NewInt(1),
},
},
expectedPoolAsset: []PoolAsset{
PoolAsset{
{
Token: sdk.NewInt64Coin("bar", 200),
Weight: sdk.NewInt(1),
},
PoolAsset{
{
Token: sdk.NewInt64Coin("foo", 100),
Weight: sdk.NewInt(1),
},
Expand Down
Loading