Skip to content

Upgrade v10 #150

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

Merged
merged 2 commits into from
Jul 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion __fixtures__/chain1/osmosis/epochs/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";

option go_package = "github.com/osmosis-labs/osmosis/v7/x/epochs/types";
option go_package = "github.com/osmosis-labs/osmosis/v9/x/epochs/types";

message EpochInfo {
string identifier = 1;
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/chain1/osmosis/epochs/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "osmosis/epochs/genesis.proto";

option go_package = "github.com/osmosis-labs/osmosis/v7/x/epochs/types";
option go_package = "github.com/osmosis-labs/osmosis/v9/x/epochs/types";

// Query defines the gRPC querier service.
service Query {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
syntax = "proto3";
// this is a temporary package setup, needs migration logic
package osmosis.gamm.v1beta1;

import "cosmos_proto/cosmos.proto";
Expand All @@ -11,7 +10,7 @@ import "google/protobuf/timestamp.proto";
import "cosmos/auth/v1beta1/auth.proto";
import "cosmos/base/v1beta1/coin.proto";

option go_package = "github.com/osmosis-labs/osmosis/v7/x/gamm/pool-models/balancer";
option go_package = "github.com/osmosis-labs/osmosis/v9/x/gamm/pool-models/balancer";

// Parameters for changing the weights in a balancer pool smoothly from
// a start weight and end weight over a period of time.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
syntax = "proto3";
package osmosis.gamm.v1beta1;
package osmosis.gamm.poolmodels.balancer.v1beta1;

import "gogoproto/gogo.proto";
import "osmosis/gamm/pool-models/balancer/balancerPool.proto";

option go_package = "github.com/osmosis-labs/osmosis/v7/x/gamm/pool-models/balancer";
option go_package = "github.com/osmosis-labs/osmosis/v9/x/gamm/pool-models/balancer";

service BalancerMsg {
service Msg {
rpc CreateBalancerPool(MsgCreateBalancerPool)
returns (MsgCreateBalancerPoolResponse);
}
Expand All @@ -15,7 +15,8 @@ service BalancerMsg {
message MsgCreateBalancerPool {
string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];

PoolParams poolParams = 2 [ (gogoproto.moretags) = "yaml:\"pool_params\"" ];
osmosis.gamm.v1beta1.PoolParams poolParams = 2
[ (gogoproto.moretags) = "yaml:\"pool_params\"" ];

repeated osmosis.gamm.v1beta1.PoolAsset poolAssets = 3
[ (gogoproto.nullable) = false ];
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
syntax = "proto3";
package osmosis.gamm.poolmodels.stableswap.v1beta1;

import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";

import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";

import "cosmos/auth/v1beta1/auth.proto";
import "cosmos/base/v1beta1/coin.proto";

option go_package = "github.com/osmosis-labs/osmosis/v9/x/gamm/pool-models/stableswap";

// PoolParams defined the parameters that will be managed by the pool
// governance in the future. This params are not managed by the chain
// governance. Instead they will be managed by the token holders of the pool.
// The pool's token holders are specified in future_pool_governor.
message PoolParams {
string swapFee = 1 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.moretags) = "yaml:\"swap_fee\"",
(gogoproto.nullable) = false
];
string exitFee = 2 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.moretags) = "yaml:\"exit_fee\"",
(gogoproto.nullable) = false
];
}

// Pool is the stableswap Pool struct
message Pool {
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;
option (cosmos_proto.implements_interface) = "PoolI";

string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
uint64 id = 2;

PoolParams poolParams = 3 [
(gogoproto.moretags) = "yaml:\"stableswap_pool_params\"",
(gogoproto.nullable) = false
];

// This string specifies who will govern the pool in the future.
// Valid forms of this are:
// {token name},{duration}
// {duration}
// where {token name} if specified is the token which determines the
// governor, and if not specified is the LP token for this pool.duration is
// a time specified as 0w,1w,2w, etc. which specifies how long the token
// would need to be locked up to count in governance. 0w means no lockup.
string future_pool_governor = 4
[ (gogoproto.moretags) = "yaml:\"future_pool_governor\"" ];
// sum of all LP shares
cosmos.base.v1beta1.Coin totalShares = 5 [
(gogoproto.moretags) = "yaml:\"total_shares\"",
(gogoproto.nullable) = false
];
// assets in the pool
repeated cosmos.base.v1beta1.Coin poolLiquidity = 6 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
// for calculation amognst assets with different precisions
repeated uint64 scaling_factor = 7 [
(gogoproto.moretags) = "yaml:\"stableswap_scaling_factor\"",
(gogoproto.nullable) = false
];
// scaling_factor_governor is the address can adjust pool scaling factors
string scaling_factor_governor = 8
[ (gogoproto.moretags) = "yaml:\"scaling_factor_governor\"" ];
}
47 changes: 47 additions & 0 deletions __fixtures__/chain1/osmosis/gamm/pool-models/stableswap/tx.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
syntax = "proto3";
package osmosis.gamm.poolmodels.stableswap.v1beta1;

import "cosmos/base/v1beta1/coin.proto";
import "gogoproto/gogo.proto";
import "osmosis/gamm/pool-models/stableswap/stableswap_pool.proto";

option go_package = "github.com/osmosis-labs/osmosis/v9/x/gamm/pool-models/stableswap";

service Msg {
rpc CreateStableswapPool(MsgCreateStableswapPool)
returns (MsgCreateStableswapPoolResponse);
rpc StableSwapAdjustScalingFactors(MsgStableSwapAdjustScalingFactors)
returns (MsgStableSwapAdjustScalingFactorsResponse);
}

message MsgCreateStableswapPool {
string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];

PoolParams poolParams = 2 [ (gogoproto.moretags) = "yaml:\"pool_params\"" ];

repeated cosmos.base.v1beta1.Coin initial_pool_liquidity = 3 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];

string future_pool_governor = 4
[ (gogoproto.moretags) = "yaml:\"future_pool_governor\"" ];
}

message MsgCreateStableswapPoolResponse {
uint64 pool_id = 1 [ (gogoproto.customname) = "PoolID" ];
}

message MsgStableSwapAdjustScalingFactors {
// Sender must be the pool's scaling_factor_governor in order for the tx to
// succeed
string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
uint64 pool_id = 2 [ (gogoproto.customname) = "PoolID" ];

repeated uint64 scaling_factors = 3 [
(gogoproto.moretags) = "yaml:\"stableswap_scaling_factor\"",
(gogoproto.nullable) = false
];
}

message MsgStableSwapAdjustScalingFactorsResponse {}
2 changes: 1 addition & 1 deletion __fixtures__/chain1/osmosis/gamm/v1beta1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ message Params {
];
}

option go_package = "github.com/osmosis-labs/osmosis/v7/x/gamm/types";
option go_package = "github.com/osmosis-labs/osmosis/v9/x/gamm/types";

// GenesisState defines the gamm module's genesis state.
message GenesisState {
Expand Down
21 changes: 16 additions & 5 deletions __fixtures__/chain1/osmosis/gamm/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ import "google/api/annotations.proto";
import "google/protobuf/any.proto";
import "cosmos_proto/cosmos.proto";

option go_package = "github.com/osmosis-labs/osmosis/v7/x/gamm/types";
option go_package = "github.com/osmosis-labs/osmosis/v9/x/gamm/types";

service Query {
rpc Pools(QueryPoolsRequest) returns (QueryPoolsResponse) {
option (google.api.http).get = "/osmosis/gamm/v1beta1/pools";
}

rpc NumPools(QueryNumPoolsRequest) returns (QueryNumPoolsResponse) {
option (google.api.http).get = "/osmosis/gamm/v1beta1/num_pools";
}

rpc TotalLiquidity(QueryTotalLiquidityRequest)
returns (QueryTotalLiquidityResponse) {
option (google.api.http).get = "/osmosis/gamm/v1beta1/total_liquidity";
Expand All @@ -28,6 +30,7 @@ service Query {
rpc Pool(QueryPoolRequest) returns (QueryPoolResponse) {
option (google.api.http).get = "/osmosis/gamm/v1beta1/pools/{poolId}";
}

rpc PoolParams(QueryPoolParamsRequest) returns (QueryPoolParamsResponse) {
option (google.api.http).get =
"/osmosis/gamm/v1beta1/pools/{poolId}/params";
Expand All @@ -44,6 +47,8 @@ service Query {
"/osmosis/gamm/v1beta1/pools/{poolId}/total_shares";
}

// SpotPrice defines a gRPC query handler that returns the spot price given
// a base denomination and a quote denomination.
rpc SpotPrice(QuerySpotPriceRequest) returns (QuerySpotPriceResponse) {
option (google.api.http).get =
"/osmosis/gamm/v1beta1/pools/{poolId}/prices";
Expand All @@ -55,6 +60,7 @@ service Query {
option (google.api.http).get =
"/osmosis/gamm/v1beta1/{poolId}/estimate/swap_exact_amount_in";
}

rpc EstimateSwapExactAmountOut(QuerySwapExactAmountOutRequest)
returns (QuerySwapExactAmountOutResponse) {
option (google.api.http).get =
Expand Down Expand Up @@ -119,15 +125,20 @@ message QueryTotalSharesResponse {
];
}

//=============================== SpotPrice
// QuerySpotPriceRequest defines the gRPC request structure for a SpotPrice
// query.
message QuerySpotPriceRequest {
uint64 poolId = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
string tokenInDenom = 2 [ (gogoproto.moretags) = "yaml:\"token_in_denom\"" ];
string tokenOutDenom = 3
[ (gogoproto.moretags) = "yaml:\"token_out_denom\"" ];
string base_asset_denom = 2
[ (gogoproto.moretags) = "yaml:\"base_asset_denom\"" ];
string quote_asset_denom = 3
[ (gogoproto.moretags) = "yaml:\"quote_asset_denom\"" ];
reserved 4;
reserved "withSwapFee";
}

// QuerySpotPriceResponse defines the gRPC response structure for a SpotPrice
// query.
message QuerySpotPriceResponse {
// String of the Dec. Ex) 10.203uatom
string spotPrice = 1 [ (gogoproto.moretags) = "yaml:\"spot_price\"" ];
Expand Down
4 changes: 1 addition & 3 deletions __fixtures__/chain1/osmosis/gamm/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package osmosis.gamm.v1beta1;
import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";

option go_package = "github.com/osmosis-labs/osmosis/v7/x/gamm/types";
option go_package = "github.com/osmosis-labs/osmosis/v9/x/gamm/types";

service Msg {
rpc JoinPool(MsgJoinPool) returns (MsgJoinPoolResponse);
Expand Down Expand Up @@ -125,8 +125,6 @@ message MsgJoinSwapExternAmountIn {
(gogoproto.moretags) = "yaml:\"token_in\"",
(gogoproto.nullable) = false
];
// reserved 3;
// reserved "token_in";
string shareOutMinAmount = 4 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.moretags) = "yaml:\"share_out_min_amount\"",
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/chain1/osmosis/incentives/gauge.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "google/protobuf/timestamp.proto";
import "cosmos/base/v1beta1/coin.proto";
import "osmosis/lockup/lock.proto";

option go_package = "github.com/osmosis-labs/osmosis/v7/x/incentives/types";
option go_package = "github.com/osmosis-labs/osmosis/v9/x/incentives/types";

message Gauge {
// unique ID of a Gauge
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/chain1/osmosis/incentives/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "google/protobuf/duration.proto";
import "osmosis/incentives/params.proto";
import "osmosis/incentives/gauge.proto";

option go_package = "github.com/osmosis-labs/osmosis/v7/x/incentives/types";
option go_package = "github.com/osmosis-labs/osmosis/v9/x/incentives/types";

// GenesisState defines the incentives module's genesis state.
message GenesisState {
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/chain1/osmosis/incentives/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package osmosis.incentives;

import "gogoproto/gogo.proto";

option go_package = "github.com/osmosis-labs/osmosis/v7/x/incentives/types";
option go_package = "github.com/osmosis-labs/osmosis/v9/x/incentives/types";

// Params holds parameters for the incentives module
message Params {
Expand Down
20 changes: 19 additions & 1 deletion __fixtures__/chain1/osmosis/incentives/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "cosmos/base/query/v1beta1/pagination.proto";
import "osmosis/incentives/gauge.proto";
import "osmosis/lockup/lock.proto";

option go_package = "github.com/osmosis-labs/osmosis/v7/x/incentives/types";
option go_package = "github.com/osmosis-labs/osmosis/v9/x/incentives/types";

// Query defines the gRPC querier service.
service Query {
Expand Down Expand Up @@ -39,6 +39,7 @@ service Query {
rpc ActiveGauges(ActiveGaugesRequest) returns (ActiveGaugesResponse) {
option (google.api.http).get = "/osmosis/incentives/v1beta1/active_gauges";
}
// returns active gauges per denom
rpc ActiveGaugesPerDenom(ActiveGaugesPerDenomRequest)
returns (ActiveGaugesPerDenomResponse) {
option (google.api.http).get =
Expand All @@ -49,6 +50,13 @@ service Query {
option (google.api.http).get =
"/osmosis/incentives/v1beta1/upcoming_gauges";
}
// returns scheduled gauges per denom
rpc UpcomingGaugesPerDenom(UpcomingGaugesPerDenomRequest)
returns (UpcomingGaugesPerDenomResponse) {
option (google.api.http).get =
"/osmosis/incentives/v1beta1/upcoming_gauges_per_denom";
}

// RewardsEst returns an estimate of the rewards at a future specific time.
// The querier either provides an address or a set of locks
// for which they want to find the associated rewards.
Expand Down Expand Up @@ -124,6 +132,16 @@ message UpcomingGaugesResponse {
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message UpcomingGaugesPerDenomRequest {
string denom = 1;
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}

message UpcomingGaugesPerDenomResponse {
repeated Gauge upcoming_gauges = 1 [ (gogoproto.nullable) = false ];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message RewardsEstRequest {
string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
repeated uint64 lock_ids = 2;
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/chain1/osmosis/incentives/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "cosmos/base/v1beta1/coin.proto";
import "osmosis/incentives/gauge.proto";
import "osmosis/lockup/lock.proto";

option go_package = "github.com/osmosis-labs/osmosis/v7/x/incentives/types";
option go_package = "github.com/osmosis-labs/osmosis/v9/x/incentives/types";

service Msg {
rpc CreateGauge(MsgCreateGauge) returns (MsgCreateGaugeResponse);
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/chain1/osmosis/lockup/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package osmosis.lockup;
import "gogoproto/gogo.proto";
import "osmosis/lockup/lock.proto";

option go_package = "github.com/osmosis-labs/osmosis/v7/x/lockup/types";
option go_package = "github.com/osmosis-labs/osmosis/v9/x/lockup/types";

// GenesisState defines the lockup module's genesis state.
message GenesisState {
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/chain1/osmosis/lockup/lock.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "cosmos/base/v1beta1/coin.proto";

option go_package = "github.com/osmosis-labs/osmosis/v7/x/lockup/types";
option go_package = "github.com/osmosis-labs/osmosis/v9/x/lockup/types";

// PeriodLock is a single unit of lock by period. It's a record of locked coin
// at a specific time. It stores owner, duration, unlock time and the amount of
Expand Down
Loading