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

Feat: whitelist LPs #NTRN-442 #11

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 protos/neutron-src
Submodule neutron-src updated 60 files
+1 −1 Dockerfile.builder
+6 −2 app/app.go
+1 −1 app/upgrades/v5.0.0/constants.go
+18 −0 app/upgrades/v5.0.2/constants.go
+35 −0 app/upgrades/v5.0.2/upgrades.go
+37 −0 app/upgrades/v5.0.2/upgrades_test.go
+3 −1 cmd/neutrond/root.go
+952 −356 docs/static/swagger.yaml
+47 −39 go.mod
+90 −97 go.sum
+1 −1 network/hermes/create-conn.sh
+16 −0 proto/neutron/contractmanager/tx.proto
+3 −0 proto/neutron/dex/params.proto
+1 −1 proto/neutron/dex/query.proto
+28 −26 proto/neutron/interchainqueries/genesis.proto
+7 −9 proto/neutron/interchainqueries/params.proto
+40 −11 proto/neutron/interchainqueries/query.proto
+103 −56 proto/neutron/interchainqueries/tx.proto
+22 −1 proto/osmosis/tokenfactory/v1beta1/query.proto
+10 −0 testutil/test_helpers.go
+4 −4 wasmbinding/bindings/query.go
+44 −32 wasmbinding/message_plugin.go
+1 −1 wasmbinding/queries.go
+19 −18 wasmbinding/query_plugin.go
+15 −5 wasmbinding/stargate_allowlist.go
+16 −12 wasmbinding/test/custom_message_test.go
+3 −2 x/contractmanager/keeper/failure.go
+30 −6 x/contractmanager/keeper/failure_test.go
+10 −0 x/contractmanager/keeper/grpc_query.go
+29 −0 x/contractmanager/keeper/msg_server.go
+2 −0 x/contractmanager/types/codec.go
+1 −0 x/contractmanager/types/errors.go
+21 −7 x/contractmanager/types/sudo.go
+29 −0 x/contractmanager/types/tx.go
+378 −8 x/contractmanager/types/tx.pb.go
+9 −0 x/dex/keeper/core_helper.go
+5 −2 x/dex/keeper/deposit.go
+1 −1 x/dex/keeper/grpc_query_simulate_place_limit_order.go
+16 −0 x/dex/keeper/integration_deposit_singlesided_test.go
+27 −1 x/dex/keeper/params_test.go
+20 −12 x/dex/keeper/place_limit_order.go
+5 −0 x/dex/types/events.go
+28 −2 x/dex/types/params.go
+78 −20 x/dex/types/params.pb.go
+173 −173 x/dex/types/query.pb.go
+1 −1 x/dex/types/query.pb.gw.go
+3 −0 x/interchainqueries/README.md
+29 −16 x/interchainqueries/types/genesis.pb.go
+7 −7 x/interchainqueries/types/params.pb.go
+134 −58 x/interchainqueries/types/query.pb.go
+131 −49 x/interchainqueries/types/tx.pb.go
+0 −13 x/interchaintxs/types/tx.go
+222 −0 x/tokenfactory/keeper/before_send_test.go
+13 −0 x/tokenfactory/keeper/grpc_query.go
+10 −0 x/tokenfactory/keeper/keeper_test.go
+ x/tokenfactory/keeper/testdata/infinite_track_beforesend.wasm
+ x/tokenfactory/keeper/testdata/no100.wasm
+3 −1 x/tokenfactory/types/constants.go
+487 −45 x/tokenfactory/types/query.pb.go
+123 −0 x/tokenfactory/types/query.pb.gw.go
2 changes: 1 addition & 1 deletion scripts/set-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ readonly BLOCK_SDK_REV="v2.1.5"
readonly COSMOS_SDK_REV="v0.50.9-neutron"
readonly FEEMARKET_REV="v1.1.1"
readonly IBC_GO_REV="v8.5.1"
readonly NEUTRON_REV="main"
readonly NEUTRON_REV="fd655299cadfd9f94a7f5772e8c688886cec37fd"
readonly SLINKY_REV="v1.0.12"
readonly WASMD_REV="v0.51.2-neutron"
readonly ICS_REV="v5.1.1"
Expand Down
20 changes: 20 additions & 0 deletions src/neutron/dex/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ export interface Params {
paused: boolean;
maxJitsPerBlock: bigint;
goodTilPurgeAllowance: bigint;
/**
* Whitelisted_lps have special LP privileges;
* currently, the only such privilege is depositing outside of the allowed fee_tiers.
*/
whitelistedLps: string[];
}
function createBaseParams(): Params {
return {
feeTiers: [],
paused: false,
maxJitsPerBlock: BigInt(0),
goodTilPurgeAllowance: BigInt(0),
whitelistedLps: [],
};
}
export const Params = {
Expand All @@ -35,6 +41,9 @@ export const Params = {
if (message.goodTilPurgeAllowance !== BigInt(0)) {
writer.uint32(40).uint64(message.goodTilPurgeAllowance);
}
for (const v of message.whitelistedLps) {
writer.uint32(50).string(v!);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Params {
Expand Down Expand Up @@ -63,6 +72,9 @@ export const Params = {
case 5:
message.goodTilPurgeAllowance = reader.uint64();
break;
case 6:
message.whitelistedLps.push(reader.string());
break;
default:
reader.skipType(tag & 7);
break;
Expand All @@ -77,6 +89,8 @@ export const Params = {
if (isSet(object.maxJitsPerBlock)) obj.maxJitsPerBlock = BigInt(object.maxJitsPerBlock.toString());
if (isSet(object.goodTilPurgeAllowance))
obj.goodTilPurgeAllowance = BigInt(object.goodTilPurgeAllowance.toString());
if (Array.isArray(object?.whitelistedLps))
obj.whitelistedLps = object.whitelistedLps.map((e: any) => String(e));
return obj;
},
toJSON(message: Params): JsonSafe<Params> {
Expand All @@ -91,6 +105,11 @@ export const Params = {
(obj.maxJitsPerBlock = (message.maxJitsPerBlock || BigInt(0)).toString());
message.goodTilPurgeAllowance !== undefined &&
(obj.goodTilPurgeAllowance = (message.goodTilPurgeAllowance || BigInt(0)).toString());
if (message.whitelistedLps) {
obj.whitelistedLps = message.whitelistedLps.map((e) => e);
} else {
obj.whitelistedLps = [];
}
return obj;
},
fromPartial<I extends Exact<DeepPartial<Params>, I>>(object: I): Params {
Expand All @@ -103,6 +122,7 @@ export const Params = {
if (object.goodTilPurgeAllowance !== undefined && object.goodTilPurgeAllowance !== null) {
message.goodTilPurgeAllowance = BigInt(object.goodTilPurgeAllowance.toString());
}
message.whitelistedLps = object.whitelistedLps?.map((e) => e) || [];
return message;
},
};