diff --git a/Makefile b/Makefile index 862c3ef38c0..a4e4936d784 100644 --- a/Makefile +++ b/Makefile @@ -13,18 +13,6 @@ proto-gen: @echo "Generating Protobuf files" @$(protoImage) sh ./protocol/scripts/protocgen.sh -proto-clean: - @rm -rf ./proto/.proto-export - @rm -rf ./.proto-export - -proto-gen-clean: - @echo "Cleaning old artifacts" - @rm -rf ./proto/.proto-export - @rm -rf ./.proto-export - @echo "Generating Protobuf files" - @$(protoImage) sh ./protocol/scripts/protocgen.sh - @cd proto && make proto-export-v4-proto-js - proto-check-bc-breaking: @rm -rf ./.proto-export @$(protoImage) buf breaking --against .git#branch=$$(git merge-base HEAD origin/main) diff --git a/indexer/packages/v4-protos/package.json b/indexer/packages/v4-protos/package.json index 0d15ab26aa8..4c7b816821f 100644 --- a/indexer/packages/v4-protos/package.json +++ b/indexer/packages/v4-protos/package.json @@ -10,7 +10,7 @@ "build:prod": "rm -rf build/ && tsc", "build:watch": "pnpm run build -- --watch", "test": "echo \"Error: no test specified\"", - "build:proto": "(cd ../../../proto && rm -rf .proto-export && cd ../ && rm -rf .proto-export && make proto-export) && rm -rf src/codegen && telescope transpile --protoDirs ../../../.proto-export --outPath ./src/codegen --no-includeAminos --includeLCDClients --includeRPCClients", + "build:proto": "(cd ../../.. && make proto-export) && rm -rf src/codegen && telescope transpile --protoDirs ../../../.proto-export --outPath ./src/codegen --no-includeAminos --includeLCDClients --includeRPCClients", "build:verify-proto": "pnpm run build:proto && git diff --exit-code src/codegen", "postinstall": "patch-package" }, diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/affiliates.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/affiliates.ts index 6c3e30c8668..f6ded433c8a 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/affiliates.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/affiliates.ts @@ -74,60 +74,6 @@ export interface AffiliateWhitelist_TierSDKType { taker_fee_share_ppm: number; } -/** AffiliateParameters defines the parameters for the affiliate program. */ - -export interface AffiliateParameters { - /** - * Maximum attributable volume for a referred user in a 30d rolling window in - * notional - */ - maximum_30dAttributableVolumePerReferredUserQuoteQuantums: Long; - /** Referred user automatically gets set to this fee tier */ - - refereeMinimumFeeTierIdx: number; - /** - * Maximum affiliate revenue for a referred user in a 30d rolling window in - * quote quantums - */ - - maximum_30dAffiliateRevenuePerReferredUserQuoteQuantums: Long; -} -/** AffiliateParameters defines the parameters for the affiliate program. */ - -export interface AffiliateParametersSDKType { - /** - * Maximum attributable volume for a referred user in a 30d rolling window in - * notional - */ - maximum_30d_attributable_volume_per_referred_user_quote_quantums: Long; - /** Referred user automatically gets set to this fee tier */ - - referee_minimum_fee_tier_idx: number; - /** - * Maximum affiliate revenue for a referred user in a 30d rolling window in - * quote quantums - */ - - maximum_30d_affiliate_revenue_per_referred_user_quote_quantums: Long; -} -/** AffiliateOverrides defines the affiliate whitelist. */ - -export interface AffiliateOverrides { - /** - * List of unique whitelisted addresses. - * These are automatically put at the maximum affiliate tier - */ - addresses: string[]; -} -/** AffiliateOverrides defines the affiliate whitelist. */ - -export interface AffiliateOverridesSDKType { - /** - * List of unique whitelisted addresses. - * These are automatically put at the maximum affiliate tier - */ - addresses: string[]; -} function createBaseAffiliateTiers(): AffiliateTiers { return { @@ -337,114 +283,4 @@ export const AffiliateWhitelist_Tier = { return message; } -}; - -function createBaseAffiliateParameters(): AffiliateParameters { - return { - maximum_30dAttributableVolumePerReferredUserQuoteQuantums: Long.UZERO, - refereeMinimumFeeTierIdx: 0, - maximum_30dAffiliateRevenuePerReferredUserQuoteQuantums: Long.UZERO - }; -} - -export const AffiliateParameters = { - encode(message: AffiliateParameters, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.maximum_30dAttributableVolumePerReferredUserQuoteQuantums.isZero()) { - writer.uint32(8).uint64(message.maximum_30dAttributableVolumePerReferredUserQuoteQuantums); - } - - if (message.refereeMinimumFeeTierIdx !== 0) { - writer.uint32(16).uint32(message.refereeMinimumFeeTierIdx); - } - - if (!message.maximum_30dAffiliateRevenuePerReferredUserQuoteQuantums.isZero()) { - writer.uint32(24).uint64(message.maximum_30dAffiliateRevenuePerReferredUserQuoteQuantums); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): AffiliateParameters { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAffiliateParameters(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.maximum_30dAttributableVolumePerReferredUserQuoteQuantums = (reader.uint64() as Long); - break; - - case 2: - message.refereeMinimumFeeTierIdx = reader.uint32(); - break; - - case 3: - message.maximum_30dAffiliateRevenuePerReferredUserQuoteQuantums = (reader.uint64() as Long); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(object: DeepPartial): AffiliateParameters { - const message = createBaseAffiliateParameters(); - message.maximum_30dAttributableVolumePerReferredUserQuoteQuantums = object.maximum_30dAttributableVolumePerReferredUserQuoteQuantums !== undefined && object.maximum_30dAttributableVolumePerReferredUserQuoteQuantums !== null ? Long.fromValue(object.maximum_30dAttributableVolumePerReferredUserQuoteQuantums) : Long.UZERO; - message.refereeMinimumFeeTierIdx = object.refereeMinimumFeeTierIdx ?? 0; - message.maximum_30dAffiliateRevenuePerReferredUserQuoteQuantums = object.maximum_30dAffiliateRevenuePerReferredUserQuoteQuantums !== undefined && object.maximum_30dAffiliateRevenuePerReferredUserQuoteQuantums !== null ? Long.fromValue(object.maximum_30dAffiliateRevenuePerReferredUserQuoteQuantums) : Long.UZERO; - return message; - } - -}; - -function createBaseAffiliateOverrides(): AffiliateOverrides { - return { - addresses: [] - }; -} - -export const AffiliateOverrides = { - encode(message: AffiliateOverrides, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.addresses) { - writer.uint32(10).string(v!); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): AffiliateOverrides { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAffiliateOverrides(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.addresses.push(reader.string()); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(object: DeepPartial): AffiliateOverrides { - const message = createBaseAffiliateOverrides(); - message.addresses = object.addresses?.map(e => e) || []; - return message; - } - }; \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/query.lcd.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/query.lcd.ts index 110db15600a..4abc5b7a4a1 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/query.lcd.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/query.lcd.ts @@ -1,5 +1,5 @@ import { LCDClient } from "@osmonauts/lcd"; -import { AffiliateInfoRequest, AffiliateInfoResponseSDKType, ReferredByRequest, ReferredByResponseSDKType, AllAffiliateTiersRequest, AllAffiliateTiersResponseSDKType, AffiliateWhitelistRequest, AffiliateWhitelistResponseSDKType, AffiliateParametersRequest, AffiliateParametersResponseSDKType, AffiliateOverridesRequest, AffiliateOverridesResponseSDKType } from "./query"; +import { AffiliateInfoRequest, AffiliateInfoResponseSDKType, ReferredByRequest, ReferredByResponseSDKType, AllAffiliateTiersRequest, AllAffiliateTiersResponseSDKType, AffiliateWhitelistRequest, AffiliateWhitelistResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; @@ -13,8 +13,6 @@ export class LCDQueryClient { this.referredBy = this.referredBy.bind(this); this.allAffiliateTiers = this.allAffiliateTiers.bind(this); this.affiliateWhitelist = this.affiliateWhitelist.bind(this); - this.affiliateParameters = this.affiliateParameters.bind(this); - this.affiliateOverrides = this.affiliateOverrides.bind(this); } /* Query AffiliateInfo returns the affiliate info for a given address. */ @@ -44,19 +42,5 @@ export class LCDQueryClient { const endpoint = `dydxprotocol/affiliates/affiliate_whitelist`; return await this.req.get(endpoint); } - /* Query AffiliateParameters returns the affiliate parameters. */ - - - async affiliateParameters(_params: AffiliateParametersRequest = {}): Promise { - const endpoint = `dydxprotocol/affiliates/affiliate_parameters`; - return await this.req.get(endpoint); - } - /* Query AffiliateOverrides returns the affiliate overrides. */ - - - async affiliateOverrides(_params: AffiliateOverridesRequest = {}): Promise { - const endpoint = `dydxprotocol/affiliates/affiliate_overrides`; - return await this.req.get(endpoint); - } } \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/query.rpc.Query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/query.rpc.Query.ts index 4a1ebe24c0d..4815a3585df 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/query.rpc.Query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../helpers"; import * as _m0 from "protobufjs/minimal"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { AffiliateInfoRequest, AffiliateInfoResponse, ReferredByRequest, ReferredByResponse, AllAffiliateTiersRequest, AllAffiliateTiersResponse, AffiliateWhitelistRequest, AffiliateWhitelistResponse, AffiliateParametersRequest, AffiliateParametersResponse, AffiliateOverridesRequest, AffiliateOverridesResponse } from "./query"; +import { AffiliateInfoRequest, AffiliateInfoResponse, ReferredByRequest, ReferredByResponse, AllAffiliateTiersRequest, AllAffiliateTiersResponse, AffiliateWhitelistRequest, AffiliateWhitelistResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { @@ -16,12 +16,6 @@ export interface Query { /** Query AffiliateWhitelist returns the affiliate whitelist. */ affiliateWhitelist(request?: AffiliateWhitelistRequest): Promise; - /** Query AffiliateParameters returns the affiliate parameters. */ - - affiliateParameters(request?: AffiliateParametersRequest): Promise; - /** Query AffiliateOverrides returns the affiliate overrides. */ - - affiliateOverrides(request?: AffiliateOverridesRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -32,8 +26,6 @@ export class QueryClientImpl implements Query { this.referredBy = this.referredBy.bind(this); this.allAffiliateTiers = this.allAffiliateTiers.bind(this); this.affiliateWhitelist = this.affiliateWhitelist.bind(this); - this.affiliateParameters = this.affiliateParameters.bind(this); - this.affiliateOverrides = this.affiliateOverrides.bind(this); } affiliateInfo(request: AffiliateInfoRequest): Promise { @@ -60,18 +52,6 @@ export class QueryClientImpl implements Query { return promise.then(data => AffiliateWhitelistResponse.decode(new _m0.Reader(data))); } - affiliateParameters(request: AffiliateParametersRequest = {}): Promise { - const data = AffiliateParametersRequest.encode(request).finish(); - const promise = this.rpc.request("dydxprotocol.affiliates.Query", "AffiliateParameters", data); - return promise.then(data => AffiliateParametersResponse.decode(new _m0.Reader(data))); - } - - affiliateOverrides(request: AffiliateOverridesRequest = {}): Promise { - const data = AffiliateOverridesRequest.encode(request).finish(); - const promise = this.rpc.request("dydxprotocol.affiliates.Query", "AffiliateOverrides", data); - return promise.then(data => AffiliateOverridesResponse.decode(new _m0.Reader(data))); - } - } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -91,14 +71,6 @@ export const createRpcQueryExtension = (base: QueryClient) => { affiliateWhitelist(request?: AffiliateWhitelistRequest): Promise { return queryService.affiliateWhitelist(request); - }, - - affiliateParameters(request?: AffiliateParametersRequest): Promise { - return queryService.affiliateParameters(request); - }, - - affiliateOverrides(request?: AffiliateOverridesRequest): Promise { - return queryService.affiliateOverrides(request); } }; diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/query.ts index 554822559db..4ccbb18adab 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/query.ts @@ -1,4 +1,4 @@ -import { AffiliateTiers, AffiliateTiersSDKType, AffiliateWhitelist, AffiliateWhitelistSDKType, AffiliateOverrides, AffiliateOverridesSDKType, AffiliateParameters, AffiliateParametersSDKType } from "./affiliates"; +import { AffiliateTiers, AffiliateTiersSDKType, AffiliateWhitelist, AffiliateWhitelistSDKType } from "./affiliates"; import * as _m0 from "protobufjs/minimal"; import { DeepPartial } from "../../helpers"; /** @@ -163,62 +163,6 @@ export interface AffiliateWhitelistResponse { export interface AffiliateWhitelistResponseSDKType { whitelist?: AffiliateWhitelistSDKType; } -/** - * AffiliateOverridesRequest is the request type for the - * Query/AffiliateOverrides RPC method. - */ - -export interface AffiliateOverridesRequest {} -/** - * AffiliateOverridesRequest is the request type for the - * Query/AffiliateOverrides RPC method. - */ - -export interface AffiliateOverridesRequestSDKType {} -/** - * AffiliateOverridesResponse is the response type for the - * Query/AffiliateOverrides RPC method. - */ - -export interface AffiliateOverridesResponse { - overrides?: AffiliateOverrides; -} -/** - * AffiliateOverridesResponse is the response type for the - * Query/AffiliateOverrides RPC method. - */ - -export interface AffiliateOverridesResponseSDKType { - overrides?: AffiliateOverridesSDKType; -} -/** - * AffiliateParametersRequest is the request type for the - * Query/AffiliateParameters RPC method. - */ - -export interface AffiliateParametersRequest {} -/** - * AffiliateParametersRequest is the request type for the - * Query/AffiliateParameters RPC method. - */ - -export interface AffiliateParametersRequestSDKType {} -/** - * AffiliateParametersResponse is the response type for the - * Query/AffiliateParameters RPC method. - */ - -export interface AffiliateParametersResponse { - parameters?: AffiliateParameters; -} -/** - * AffiliateParametersResponse is the response type for the - * Query/AffiliateParameters RPC method. - */ - -export interface AffiliateParametersResponseSDKType { - parameters?: AffiliateParametersSDKType; -} function createBaseAffiliateInfoRequest(): AffiliateInfoRequest { return { @@ -606,162 +550,4 @@ export const AffiliateWhitelistResponse = { return message; } -}; - -function createBaseAffiliateOverridesRequest(): AffiliateOverridesRequest { - return {}; -} - -export const AffiliateOverridesRequest = { - encode(_: AffiliateOverridesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): AffiliateOverridesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAffiliateOverridesRequest(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(_: DeepPartial): AffiliateOverridesRequest { - const message = createBaseAffiliateOverridesRequest(); - return message; - } - -}; - -function createBaseAffiliateOverridesResponse(): AffiliateOverridesResponse { - return { - overrides: undefined - }; -} - -export const AffiliateOverridesResponse = { - encode(message: AffiliateOverridesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.overrides !== undefined) { - AffiliateOverrides.encode(message.overrides, writer.uint32(10).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): AffiliateOverridesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAffiliateOverridesResponse(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.overrides = AffiliateOverrides.decode(reader, reader.uint32()); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(object: DeepPartial): AffiliateOverridesResponse { - const message = createBaseAffiliateOverridesResponse(); - message.overrides = object.overrides !== undefined && object.overrides !== null ? AffiliateOverrides.fromPartial(object.overrides) : undefined; - return message; - } - -}; - -function createBaseAffiliateParametersRequest(): AffiliateParametersRequest { - return {}; -} - -export const AffiliateParametersRequest = { - encode(_: AffiliateParametersRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): AffiliateParametersRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAffiliateParametersRequest(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(_: DeepPartial): AffiliateParametersRequest { - const message = createBaseAffiliateParametersRequest(); - return message; - } - -}; - -function createBaseAffiliateParametersResponse(): AffiliateParametersResponse { - return { - parameters: undefined - }; -} - -export const AffiliateParametersResponse = { - encode(message: AffiliateParametersResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.parameters !== undefined) { - AffiliateParameters.encode(message.parameters, writer.uint32(10).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): AffiliateParametersResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAffiliateParametersResponse(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.parameters = AffiliateParameters.decode(reader, reader.uint32()); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(object: DeepPartial): AffiliateParametersResponse { - const message = createBaseAffiliateParametersResponse(); - message.parameters = object.parameters !== undefined && object.parameters !== null ? AffiliateParameters.fromPartial(object.parameters) : undefined; - return message; - } - }; \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/tx.rpc.msg.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/tx.rpc.msg.ts index 090ea4c557f..da9e7b4ae3f 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/tx.rpc.msg.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../helpers"; import * as _m0 from "protobufjs/minimal"; -import { MsgRegisterAffiliate, MsgRegisterAffiliateResponse, MsgUpdateAffiliateTiers, MsgUpdateAffiliateTiersResponse, MsgUpdateAffiliateWhitelist, MsgUpdateAffiliateWhitelistResponse, MsgUpdateAffiliateParameters, MsgUpdateAffiliateParametersResponse, MsgUpdateAffiliateOverrides, MsgUpdateAffiliateOverridesResponse } from "./tx"; +import { MsgRegisterAffiliate, MsgRegisterAffiliateResponse, MsgUpdateAffiliateTiers, MsgUpdateAffiliateTiersResponse, MsgUpdateAffiliateWhitelist, MsgUpdateAffiliateWhitelistResponse } from "./tx"; /** Msg defines the Msg service. */ export interface Msg { @@ -12,12 +12,6 @@ export interface Msg { /** UpdateAffiliateWhitelist updates affiliate whitelist */ updateAffiliateWhitelist(request: MsgUpdateAffiliateWhitelist): Promise; - /** UpdateAffiliateParameters updates affiliate program parameters */ - - updateAffiliateParameters(request: MsgUpdateAffiliateParameters): Promise; - /** UpdateAffiliateOverrides updates affiliate overrides */ - - updateAffiliateOverrides(request: MsgUpdateAffiliateOverrides): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -27,8 +21,6 @@ export class MsgClientImpl implements Msg { this.registerAffiliate = this.registerAffiliate.bind(this); this.updateAffiliateTiers = this.updateAffiliateTiers.bind(this); this.updateAffiliateWhitelist = this.updateAffiliateWhitelist.bind(this); - this.updateAffiliateParameters = this.updateAffiliateParameters.bind(this); - this.updateAffiliateOverrides = this.updateAffiliateOverrides.bind(this); } registerAffiliate(request: MsgRegisterAffiliate): Promise { @@ -49,16 +41,4 @@ export class MsgClientImpl implements Msg { return promise.then(data => MsgUpdateAffiliateWhitelistResponse.decode(new _m0.Reader(data))); } - updateAffiliateParameters(request: MsgUpdateAffiliateParameters): Promise { - const data = MsgUpdateAffiliateParameters.encode(request).finish(); - const promise = this.rpc.request("dydxprotocol.affiliates.Msg", "UpdateAffiliateParameters", data); - return promise.then(data => MsgUpdateAffiliateParametersResponse.decode(new _m0.Reader(data))); - } - - updateAffiliateOverrides(request: MsgUpdateAffiliateOverrides): Promise { - const data = MsgUpdateAffiliateOverrides.encode(request).finish(); - const promise = this.rpc.request("dydxprotocol.affiliates.Msg", "UpdateAffiliateOverrides", data); - return promise.then(data => MsgUpdateAffiliateOverridesResponse.decode(new _m0.Reader(data))); - } - } \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/tx.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/tx.ts index 55ed818f644..1e6721656ac 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/tx.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/tx.ts @@ -1,4 +1,4 @@ -import { AffiliateTiers, AffiliateTiersSDKType, AffiliateWhitelist, AffiliateWhitelistSDKType, AffiliateParameters, AffiliateParametersSDKType, AffiliateOverrides, AffiliateOverridesSDKType } from "./affiliates"; +import { AffiliateTiers, AffiliateTiersSDKType, AffiliateWhitelist, AffiliateWhitelistSDKType } from "./affiliates"; import * as _m0 from "protobufjs/minimal"; import { DeepPartial } from "../../helpers"; /** Message to register a referee-affiliate relationship */ @@ -73,54 +73,6 @@ export interface MsgUpdateAffiliateWhitelistResponse {} /** Response to MsgUpdateAffiliateWhitelist */ export interface MsgUpdateAffiliateWhitelistResponseSDKType {} -/** Message to update affiliate program parameters */ - -export interface MsgUpdateAffiliateParameters { - /** Authority sending this message. Will be sent by gov */ - authority: string; - /** Affiliate program parameters */ - - affiliateParameters?: AffiliateParameters; -} -/** Message to update affiliate program parameters */ - -export interface MsgUpdateAffiliateParametersSDKType { - /** Authority sending this message. Will be sent by gov */ - authority: string; - /** Affiliate program parameters */ - - affiliate_parameters?: AffiliateParametersSDKType; -} -/** Response to MsgUpdateAffiliateParameters */ - -export interface MsgUpdateAffiliateParametersResponse {} -/** Response to MsgUpdateAffiliateParameters */ - -export interface MsgUpdateAffiliateParametersResponseSDKType {} -/** Message to update affiliate overrides */ - -export interface MsgUpdateAffiliateOverrides { - /** Authority sending this message. Will be sent by gov */ - authority: string; - /** Addresses that automatically have the maximum affiliate tier */ - - affiliateOverrides?: AffiliateOverrides; -} -/** Message to update affiliate overrides */ - -export interface MsgUpdateAffiliateOverridesSDKType { - /** Authority sending this message. Will be sent by gov */ - authority: string; - /** Addresses that automatically have the maximum affiliate tier */ - - affiliate_overrides?: AffiliateOverridesSDKType; -} -/** Response to MsgUpdateAffiliateOverrides */ - -export interface MsgUpdateAffiliateOverridesResponse {} -/** Response to MsgUpdateAffiliateOverrides */ - -export interface MsgUpdateAffiliateOverridesResponseSDKType {} function createBaseMsgRegisterAffiliate(): MsgRegisterAffiliate { return { @@ -387,182 +339,4 @@ export const MsgUpdateAffiliateWhitelistResponse = { return message; } -}; - -function createBaseMsgUpdateAffiliateParameters(): MsgUpdateAffiliateParameters { - return { - authority: "", - affiliateParameters: undefined - }; -} - -export const MsgUpdateAffiliateParameters = { - encode(message: MsgUpdateAffiliateParameters, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.authority !== "") { - writer.uint32(10).string(message.authority); - } - - if (message.affiliateParameters !== undefined) { - AffiliateParameters.encode(message.affiliateParameters, writer.uint32(18).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateAffiliateParameters { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateAffiliateParameters(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.authority = reader.string(); - break; - - case 2: - message.affiliateParameters = AffiliateParameters.decode(reader, reader.uint32()); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(object: DeepPartial): MsgUpdateAffiliateParameters { - const message = createBaseMsgUpdateAffiliateParameters(); - message.authority = object.authority ?? ""; - message.affiliateParameters = object.affiliateParameters !== undefined && object.affiliateParameters !== null ? AffiliateParameters.fromPartial(object.affiliateParameters) : undefined; - return message; - } - -}; - -function createBaseMsgUpdateAffiliateParametersResponse(): MsgUpdateAffiliateParametersResponse { - return {}; -} - -export const MsgUpdateAffiliateParametersResponse = { - encode(_: MsgUpdateAffiliateParametersResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateAffiliateParametersResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateAffiliateParametersResponse(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(_: DeepPartial): MsgUpdateAffiliateParametersResponse { - const message = createBaseMsgUpdateAffiliateParametersResponse(); - return message; - } - -}; - -function createBaseMsgUpdateAffiliateOverrides(): MsgUpdateAffiliateOverrides { - return { - authority: "", - affiliateOverrides: undefined - }; -} - -export const MsgUpdateAffiliateOverrides = { - encode(message: MsgUpdateAffiliateOverrides, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.authority !== "") { - writer.uint32(10).string(message.authority); - } - - if (message.affiliateOverrides !== undefined) { - AffiliateOverrides.encode(message.affiliateOverrides, writer.uint32(18).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateAffiliateOverrides { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateAffiliateOverrides(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.authority = reader.string(); - break; - - case 2: - message.affiliateOverrides = AffiliateOverrides.decode(reader, reader.uint32()); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(object: DeepPartial): MsgUpdateAffiliateOverrides { - const message = createBaseMsgUpdateAffiliateOverrides(); - message.authority = object.authority ?? ""; - message.affiliateOverrides = object.affiliateOverrides !== undefined && object.affiliateOverrides !== null ? AffiliateOverrides.fromPartial(object.affiliateOverrides) : undefined; - return message; - } - -}; - -function createBaseMsgUpdateAffiliateOverridesResponse(): MsgUpdateAffiliateOverridesResponse { - return {}; -} - -export const MsgUpdateAffiliateOverridesResponse = { - encode(_: MsgUpdateAffiliateOverridesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateAffiliateOverridesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateAffiliateOverridesResponse(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(_: DeepPartial): MsgUpdateAffiliateOverridesResponse { - const message = createBaseMsgUpdateAffiliateOverridesResponse(); - return message; - } - }; \ No newline at end of file diff --git a/proto/dydxprotocol/affiliates/affiliates.proto b/proto/dydxprotocol/affiliates/affiliates.proto index ecc1fb3658d..aba3335b9d4 100644 --- a/proto/dydxprotocol/affiliates/affiliates.proto +++ b/proto/dydxprotocol/affiliates/affiliates.proto @@ -1,7 +1,6 @@ syntax = "proto3"; package dydxprotocol.affiliates; -import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/affiliates/types"; @@ -34,26 +33,4 @@ message AffiliateWhitelist { } // All affiliate whitelist tiers. repeated Tier tiers = 1 [ (gogoproto.nullable) = false ]; -} - -// AffiliateParameters defines the parameters for the affiliate program. -message AffiliateParameters { - // Maximum attributable volume for a referred user in a 30d rolling window in - // notional - uint64 maximum_30d_attributable_volume_per_referred_user_quote_quantums = 1; - - // Referred user automatically gets set to this fee tier - uint32 referee_minimum_fee_tier_idx = 2; - - // Maximum affiliate revenue for a referred user in a 30d rolling window in - // quote quantums - uint64 maximum_30d_affiliate_revenue_per_referred_user_quote_quantums = 3; -} - -// AffiliateOverrides defines the affiliate whitelist. -message AffiliateOverrides { - // List of unique whitelisted addresses. - // These are automatically put at the maximum affiliate tier - repeated string addresses = 1 - [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; -} +} \ No newline at end of file diff --git a/proto/dydxprotocol/affiliates/genesis.proto b/proto/dydxprotocol/affiliates/genesis.proto index a653747ed29..4dd0dd22918 100644 --- a/proto/dydxprotocol/affiliates/genesis.proto +++ b/proto/dydxprotocol/affiliates/genesis.proto @@ -9,7 +9,4 @@ option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/affiliates/type message GenesisState { // The list of affiliate tiers AffiliateTiers affiliate_tiers = 1 [ (gogoproto.nullable) = false ]; - - // The affiliate parameters - AffiliateParameters affiliate_parameters = 2 [ (gogoproto.nullable) = false ]; } \ No newline at end of file diff --git a/proto/dydxprotocol/affiliates/query.proto b/proto/dydxprotocol/affiliates/query.proto index 6d6697ef979..8d2d4fd6e77 100644 --- a/proto/dydxprotocol/affiliates/query.proto +++ b/proto/dydxprotocol/affiliates/query.proto @@ -32,18 +32,6 @@ service Query { option (google.api.http).get = "/dydxprotocol/affiliates/affiliate_whitelist"; }; - // Query AffiliateParameters returns the affiliate parameters. - rpc AffiliateParameters(AffiliateParametersRequest) - returns (AffiliateParametersResponse) { - option (google.api.http).get = - "/dydxprotocol/affiliates/affiliate_parameters"; - }; - // Query AffiliateOverrides returns the affiliate overrides. - rpc AffiliateOverrides(AffiliateOverridesRequest) - returns (AffiliateOverridesResponse) { - option (google.api.http).get = - "/dydxprotocol/affiliates/affiliate_overrides"; - }; } // AffiliateInfoRequest is the request type for the Query/AffiliateInfo RPC @@ -113,22 +101,4 @@ message AffiliateWhitelistRequest {} // Query/AffiliateWhitelist RPC method. message AffiliateWhitelistResponse { AffiliateWhitelist whitelist = 1 [ (gogoproto.nullable) = false ]; -} - -// AffiliateOverridesRequest is the request type for the -// Query/AffiliateOverrides RPC method. -message AffiliateOverridesRequest {} -// AffiliateOverridesResponse is the response type for the -// Query/AffiliateOverrides RPC method. -message AffiliateOverridesResponse { - AffiliateOverrides overrides = 1 [ (gogoproto.nullable) = false ]; -} - -// AffiliateParametersRequest is the request type for the -// Query/AffiliateParameters RPC method. -message AffiliateParametersRequest {} -// AffiliateParametersResponse is the response type for the -// Query/AffiliateParameters RPC method. -message AffiliateParametersResponse { - AffiliateParameters parameters = 1 [ (gogoproto.nullable) = false ]; } \ No newline at end of file diff --git a/proto/dydxprotocol/affiliates/tx.proto b/proto/dydxprotocol/affiliates/tx.proto index 8b008b97fb8..27d8fdde01b 100644 --- a/proto/dydxprotocol/affiliates/tx.proto +++ b/proto/dydxprotocol/affiliates/tx.proto @@ -19,12 +19,6 @@ service Msg { // UpdateAffiliateWhitelist updates affiliate whitelist rpc UpdateAffiliateWhitelist(MsgUpdateAffiliateWhitelist) returns (MsgUpdateAffiliateWhitelistResponse); - // UpdateAffiliateParameters updates affiliate program parameters - rpc UpdateAffiliateParameters(MsgUpdateAffiliateParameters) - returns (MsgUpdateAffiliateParametersResponse); - // UpdateAffiliateOverrides updates affiliate overrides - rpc UpdateAffiliateOverrides(MsgUpdateAffiliateOverrides) - returns (MsgUpdateAffiliateOverridesResponse); } // Message to register a referee-affiliate relationship @@ -65,29 +59,3 @@ message MsgUpdateAffiliateWhitelist { // Response to MsgUpdateAffiliateWhitelist message MsgUpdateAffiliateWhitelistResponse {} - -// Message to update affiliate program parameters -message MsgUpdateAffiliateParameters { - option (cosmos.msg.v1.signer) = "authority"; - // Authority sending this message. Will be sent by gov - string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - - // Affiliate program parameters - AffiliateParameters affiliate_parameters = 2 [ (gogoproto.nullable) = false ]; -} - -// Response to MsgUpdateAffiliateParameters -message MsgUpdateAffiliateParametersResponse {} - -// Message to update affiliate overrides -message MsgUpdateAffiliateOverrides { - option (cosmos.msg.v1.signer) = "authority"; - // Authority sending this message. Will be sent by gov - string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - - // Addresses that automatically have the maximum affiliate tier - AffiliateOverrides affiliate_overrides = 2 [ (gogoproto.nullable) = false ]; -} - -// Response to MsgUpdateAffiliateOverrides -message MsgUpdateAffiliateOverridesResponse {} \ No newline at end of file diff --git a/protocol/app/msgs/all_msgs.go b/protocol/app/msgs/all_msgs.go index c6012c47761..4a435c86158 100644 --- a/protocol/app/msgs/all_msgs.go +++ b/protocol/app/msgs/all_msgs.go @@ -151,16 +151,12 @@ var ( "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal": {}, // affiliates - "/dydxprotocol.affiliates.MsgRegisterAffiliate": {}, - "/dydxprotocol.affiliates.MsgRegisterAffiliateResponse": {}, - "/dydxprotocol.affiliates.MsgUpdateAffiliateTiers": {}, - "/dydxprotocol.affiliates.MsgUpdateAffiliateTiersResponse": {}, - "/dydxprotocol.affiliates.MsgUpdateAffiliateWhitelist": {}, - "/dydxprotocol.affiliates.MsgUpdateAffiliateWhitelistResponse": {}, - "/dydxprotocol.affiliates.MsgUpdateAffiliateParameters": {}, - "/dydxprotocol.affiliates.MsgUpdateAffiliateParametersResponse": {}, - "/dydxprotocol.affiliates.MsgUpdateAffiliateOverrides": {}, - "/dydxprotocol.affiliates.MsgUpdateAffiliateOverridesResponse": {}, + "/dydxprotocol.affiliates.MsgRegisterAffiliate": {}, + "/dydxprotocol.affiliates.MsgRegisterAffiliateResponse": {}, + "/dydxprotocol.affiliates.MsgUpdateAffiliateTiers": {}, + "/dydxprotocol.affiliates.MsgUpdateAffiliateTiersResponse": {}, + "/dydxprotocol.affiliates.MsgUpdateAffiliateWhitelist": {}, + "/dydxprotocol.affiliates.MsgUpdateAffiliateWhitelistResponse": {}, // accountplus "/dydxprotocol.accountplus.MsgAddAuthenticator": {}, diff --git a/protocol/app/msgs/internal_msgs.go b/protocol/app/msgs/internal_msgs.go index 3dcd8c875f9..41abec54489 100644 --- a/protocol/app/msgs/internal_msgs.go +++ b/protocol/app/msgs/internal_msgs.go @@ -110,14 +110,10 @@ var ( // Custom modules InternalMsgSamplesDydxCustom = map[string]sdk.Msg{ // affiliates - "/dydxprotocol.affiliates.MsgUpdateAffiliateTiers": &affiliates.MsgUpdateAffiliateTiers{}, - "/dydxprotocol.affiliates.MsgUpdateAffiliateTiersResponse": nil, - "/dydxprotocol.affiliates.MsgUpdateAffiliateWhitelist": &affiliates.MsgUpdateAffiliateWhitelist{}, - "/dydxprotocol.affiliates.MsgUpdateAffiliateWhitelistResponse": nil, - "/dydxprotocol.affiliates.MsgUpdateAffiliateParameters": &affiliates.MsgUpdateAffiliateParameters{}, - "/dydxprotocol.affiliates.MsgUpdateAffiliateParametersResponse": nil, - "/dydxprotocol.affiliates.MsgUpdateAffiliateOverrides": &affiliates.MsgUpdateAffiliateOverrides{}, - "/dydxprotocol.affiliates.MsgUpdateAffiliateOverridesResponse": nil, + "/dydxprotocol.affiliates.MsgUpdateAffiliateTiers": &affiliates.MsgUpdateAffiliateTiers{}, + "/dydxprotocol.affiliates.MsgUpdateAffiliateTiersResponse": nil, + "/dydxprotocol.affiliates.MsgUpdateAffiliateWhitelist": &affiliates.MsgUpdateAffiliateWhitelist{}, + "/dydxprotocol.affiliates.MsgUpdateAffiliateWhitelistResponse": nil, // accountplus "/dydxprotocol.accountplus.MsgSetActiveState": &accountplus.MsgSetActiveState{}, diff --git a/protocol/app/msgs/internal_msgs_test.go b/protocol/app/msgs/internal_msgs_test.go index 7b805729415..7a2d2620ce2 100644 --- a/protocol/app/msgs/internal_msgs_test.go +++ b/protocol/app/msgs/internal_msgs_test.go @@ -70,10 +70,6 @@ func TestInternalMsgSamples_Gov_Key(t *testing.T) { "/dydxprotocol.accountplus.MsgSetActiveStateResponse", // affiliates - "/dydxprotocol.affiliates.MsgUpdateAffiliateOverrides", - "/dydxprotocol.affiliates.MsgUpdateAffiliateOverridesResponse", - "/dydxprotocol.affiliates.MsgUpdateAffiliateParameters", - "/dydxprotocol.affiliates.MsgUpdateAffiliateParametersResponse", "/dydxprotocol.affiliates.MsgUpdateAffiliateTiers", "/dydxprotocol.affiliates.MsgUpdateAffiliateTiersResponse", "/dydxprotocol.affiliates.MsgUpdateAffiliateWhitelist", diff --git a/protocol/app/testdata/default_genesis_state.json b/protocol/app/testdata/default_genesis_state.json index bb80415abcb..0ffa88aba81 100644 --- a/protocol/app/testdata/default_genesis_state.json +++ b/protocol/app/testdata/default_genesis_state.json @@ -35,18 +35,8 @@ "req_referred_volume_quote_quantums": "25000000000000", "req_staked_whole_coins": 5000, "taker_fee_share_ppm": 150000 - }, - { - "req_referred_volume_quote_quantums": "50000000000000", - "req_staked_whole_coins": 1e+08, - "taker_fee_share_ppm": 250000 } ] - }, - "affiliate_parameters": { - "maximum_30d_affiliate_revenue_per_referred_user_quote_quantums": "10000000000", - "maximum_30d_attributable_volume_per_referred_user_quote_quantums": "100000000000000", - "referee_minimum_fee_tier_idx": 2 } }, "auth": { diff --git a/protocol/lib/ante/internal_msg.go b/protocol/lib/ante/internal_msg.go index 06f6b83917c..9a3af464948 100644 --- a/protocol/lib/ante/internal_msg.go +++ b/protocol/lib/ante/internal_msg.go @@ -151,9 +151,7 @@ func IsInternalMsg(msg sdk.Msg) bool { // affiliates *affiliates.MsgUpdateAffiliateTiers, - *affiliates.MsgUpdateAffiliateWhitelist, - *affiliates.MsgUpdateAffiliateOverrides, - *affiliates.MsgUpdateAffiliateParameters: + *affiliates.MsgUpdateAffiliateWhitelist: return true diff --git a/protocol/scripts/affiliates/update_affiliate_parameters.py b/protocol/scripts/affiliates/update_affiliate_overrides.py similarity index 84% rename from protocol/scripts/affiliates/update_affiliate_parameters.py rename to protocol/scripts/affiliates/update_affiliate_overrides.py index 97cbb4b5887..f66449298cb 100644 --- a/protocol/scripts/affiliates/update_affiliate_parameters.py +++ b/protocol/scripts/affiliates/update_affiliate_overrides.py @@ -87,9 +87,7 @@ def main(): parser = argparse.ArgumentParser(description='Parse market map and sync markets') parser.add_argument('--chain-id', default=staging_chain, help='Chain ID, default is dydxprotocol-testnet') parser.add_argument('--node', default=staging_node, help='Node URL, default is https://validator.v4staging.dydx.exchange:443') - parser.add_argument('--max-30d-commission', type=int, required=True, help='Maximum 30d commission per referred') - parser.add_argument('--referee-min-fee-tier', type=int, required=True, help='Referee minimum fee tier idx') - parser.add_argument('--max-30d-revenue', type=int, required=True, help='Maximum 30d affiliate revenue per affiliate') + parser.add_argument('--addresses', type=str, required=True, help='Addresses to update') args = parser.parse_args() counter = 0 @@ -100,19 +98,17 @@ def main(): affiliate_parameters_msg = { "messages": [ { - "@type": "/dydxprotocol.affiliates.MsgUpdateAffiliateParameters", + "@type": "/dydxprotocol.affiliates.MsgUpdateAffiliateOverrides", "authority": "dydx10d07y265gmmuvt4z0w9aw880jnsr700jnmapky", - "affiliate_parameters": { - "maximum_30d_commission_per_referred_quote_quantums": int(args.max_30d_commission), - "referee_minimum_fee_tier_idx": int(args.referee_min_fee_tier), - "maximum_30d_affiliate_revenue_per_affiliate_quote_quantums": int(args.max_30d_revenue), + "affiliate_overrides": { + "addresses": args.addresses } } ], "deposit": "10000000000000000000000adv4tnt", "metadata": "", - "title": "Update affiliate parameters", - "summary": f"Update affiliate parameters: max_30d_commission={args.max_30d_commission}, referee_min_fee_tier={args.referee_min_fee_tier}, max_30d_revenue={args.max_30d_revenue}" + "title": "Update affiliate overrides", + "summary": f"Update affiliate overrides" } json.dump(affiliate_parameters_msg, tmp_file, indent=2) print(affiliate_parameters_msg) diff --git a/protocol/scripts/genesis/sample_pregenesis.json b/protocol/scripts/genesis/sample_pregenesis.json index 34d5cbf64c4..6e78202357d 100644 --- a/protocol/scripts/genesis/sample_pregenesis.json +++ b/protocol/scripts/genesis/sample_pregenesis.json @@ -3,11 +3,6 @@ "app_name": "dydxprotocold", "app_state": { "affiliates": { - "affiliate_parameters": { - "maximum_30d_affiliate_revenue_per_referred_user_quote_quantums": "10000000000", - "maximum_30d_attributable_volume_per_referred_user_quote_quantums": "100000000000000", - "referee_minimum_fee_tier_idx": 2 - }, "affiliate_tiers": { "tiers": [ { @@ -29,11 +24,6 @@ "req_referred_volume_quote_quantums": "25000000000000", "req_staked_whole_coins": 5000, "taker_fee_share_ppm": 150000 - }, - { - "req_referred_volume_quote_quantums": "50000000000000", - "req_staked_whole_coins": 100000000, - "taker_fee_share_ppm": 250000 } ] } @@ -4101,7 +4091,7 @@ ] } }, - "app_version": "9.0.0-47-gd399e2625", + "app_version": "7.0.0-dev0-149-g12cfb908b", "chain_id": "dydx-sample-1", "consensus": { "params": { diff --git a/protocol/scripts/governance/example_proposal.json b/protocol/scripts/governance/example_proposal.json new file mode 100644 index 00000000000..e69de29bb2d diff --git a/protocol/x/affiliates/client/cli/query.go b/protocol/x/affiliates/client/cli/query.go index 66a0cc2e882..4b79b11d2fa 100644 --- a/protocol/x/affiliates/client/cli/query.go +++ b/protocol/x/affiliates/client/cli/query.go @@ -26,8 +26,6 @@ func GetQueryCmd(queryRoute string) *cobra.Command { GetCmdQueryAffiliateInfo(), GetCmdQueryReferredBy(), GetCmdQueryAffiliateWhitelist(), - GetCmdQueryAffiliateOverrides(), - GetCmdQueryAffiliateParameters(), ) return cmd } @@ -117,43 +115,3 @@ func GetCmdQueryAffiliateWhitelist() *cobra.Command { } return cmd } - -func GetCmdQueryAffiliateOverrides() *cobra.Command { - cmd := &cobra.Command{ - Use: "affiliate-overrides", - Short: "Query affiliate overrides", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.AffiliateOverrides(context.Background(), &types.AffiliateOverridesRequest{}) - if err != nil { - return err - } - return clientCtx.PrintProto(res) - }, - } - return cmd -} - -func GetCmdQueryAffiliateParameters() *cobra.Command { - cmd := &cobra.Command{ - Use: "affiliate-parameters", - Short: "Query affiliate parameters", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.AffiliateParameters(context.Background(), &types.AffiliateParametersRequest{}) - if err != nil { - return err - } - return clientCtx.PrintProto(res) - }, - } - return cmd -} diff --git a/protocol/x/affiliates/keeper/grpc_query.go b/protocol/x/affiliates/keeper/grpc_query.go index 584a282fb50..4da442f0130 100644 --- a/protocol/x/affiliates/keeper/grpc_query.go +++ b/protocol/x/affiliates/keeper/grpc_query.go @@ -99,27 +99,3 @@ func (k Keeper) AffiliateWhitelist(c context.Context, Whitelist: affiliateWhitelist, }, nil } - -func (k Keeper) AffiliateParameters(c context.Context, - req *types.AffiliateParametersRequest) (*types.AffiliateParametersResponse, error) { - ctx := sdk.UnwrapSDKContext(c) - - affiliateParameters, err := k.GetAffiliateParameters(ctx) - if err != nil { - return nil, err - } - - return &types.AffiliateParametersResponse{Parameters: affiliateParameters}, nil -} - -func (k Keeper) AffiliateOverrides(c context.Context, - req *types.AffiliateOverridesRequest) (*types.AffiliateOverridesResponse, error) { - ctx := sdk.UnwrapSDKContext(c) - - affiliateOverrides, err := k.GetAffiliateOverrides(ctx) - if err != nil { - return nil, err - } - - return &types.AffiliateOverridesResponse{Overrides: affiliateOverrides}, nil -} diff --git a/protocol/x/affiliates/keeper/grpc_query_test.go b/protocol/x/affiliates/keeper/grpc_query_test.go index c990b898379..ec214e7eaa9 100644 --- a/protocol/x/affiliates/keeper/grpc_query_test.go +++ b/protocol/x/affiliates/keeper/grpc_query_test.go @@ -260,44 +260,3 @@ func TestAffiliateWhitelist(t *testing.T) { require.NotNil(t, res) require.Equal(t, &types.AffiliateWhitelistResponse{Whitelist: whitelist}, res) } - -func TestAffiliateParameters(t *testing.T) { - tApp := testapp.NewTestAppBuilder(t).Build() - ctx := tApp.InitChain() - k := tApp.App.AffiliatesKeeper - - req := &types.AffiliateParametersRequest{} - err := k.UpdateAffiliateParameters(ctx, &types.MsgUpdateAffiliateParameters{ - Authority: constants.GovAuthority, - AffiliateParameters: types.DefaultAffiliateParameters, - }) - require.NoError(t, err) - - res, err := k.AffiliateParameters(ctx, req) - require.NoError(t, err) - require.NotNil(t, res) - require.Equal(t, &types.AffiliateParametersResponse{Parameters: types.DefaultAffiliateParameters}, res) -} - -func TestAffiliateOverrides(t *testing.T) { - tApp := testapp.NewTestAppBuilder(t).Build() - ctx := tApp.InitChain() - k := tApp.App.AffiliatesKeeper - - req := &types.AffiliateOverridesRequest{} - err := k.SetAffiliateOverrides(ctx, types.AffiliateOverrides{ - Addresses: []string{ - constants.AliceAccAddress.String(), - }, - }) - require.NoError(t, err) - - res, err := k.AffiliateOverrides(ctx, req) - require.NoError(t, err) - require.NotNil(t, res) - require.Equal(t, &types.AffiliateOverridesResponse{Overrides: types.AffiliateOverrides{ - Addresses: []string{ - constants.AliceAccAddress.String(), - }, - }}, res) -} diff --git a/protocol/x/affiliates/keeper/keeper.go b/protocol/x/affiliates/keeper/keeper.go index 028a8519ebd..52cb1bfd3a6 100644 --- a/protocol/x/affiliates/keeper/keeper.go +++ b/protocol/x/affiliates/keeper/keeper.go @@ -10,6 +10,7 @@ import ( storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/dydxprotocol/v4-chain/protocol/dtypes" indexerevents "github.com/dydxprotocol/v4-chain/protocol/indexer/events" "github.com/dydxprotocol/v4-chain/protocol/indexer/indexer_manager" "github.com/dydxprotocol/v4-chain/protocol/lib" @@ -108,6 +109,54 @@ func (k Keeper) GetReferredBy(ctx sdk.Context, referee string) (string, bool) { return string(referredByPrefixStore.Get([]byte(referee))), true } +// AddReferredVolume adds the referred volume from a block to the affiliate's referred volume. +func (k Keeper) AddReferredVolume( + ctx sdk.Context, + affiliateAddr string, + referredVolumeFromBlock *big.Int, +) error { + affiliateReferredVolumePrefixStore := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.ReferredVolumeKeyPrefix)) + referredVolume := big.NewInt(0) + + if affiliateReferredVolumePrefixStore.Has([]byte(affiliateAddr)) { + prevReferredVolumeFromState := dtypes.SerializableInt{} + if err := prevReferredVolumeFromState.Unmarshal( + affiliateReferredVolumePrefixStore.Get([]byte(affiliateAddr)), + ); err != nil { + return errorsmod.Wrapf(types.ErrUpdatingAffiliateReferredVolume, + "affiliate %s, error: %s", affiliateAddr, err) + } + referredVolume = prevReferredVolumeFromState.BigInt() + } + + referredVolume.Add( + referredVolume, + referredVolumeFromBlock, + ) + updatedReferedVolume := dtypes.NewIntFromBigInt(referredVolume) + + updatedReferredVolumeBytes, err := updatedReferedVolume.Marshal() + if err != nil { + return errorsmod.Wrapf(types.ErrUpdatingAffiliateReferredVolume, + "affiliate %s, error: %s", affiliateAddr, err) + } + affiliateReferredVolumePrefixStore.Set([]byte(affiliateAddr), updatedReferredVolumeBytes) + return nil +} + +// GetReferredVolume returns all time referred volume for an affiliate address. +func (k Keeper) GetReferredVolume(ctx sdk.Context, affiliateAddr string) (*big.Int, error) { + affiliateReferredVolumePrefixStore := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.ReferredVolumeKeyPrefix)) + if !affiliateReferredVolumePrefixStore.Has([]byte(affiliateAddr)) { + return big.NewInt(0), nil + } + var referredVolume dtypes.SerializableInt + if err := referredVolume.Unmarshal(affiliateReferredVolumePrefixStore.Get([]byte(affiliateAddr))); err != nil { + return big.NewInt(0), err + } + return referredVolume.BigInt(), nil +} + // GetAllAffiliateTiers returns all affiliate tiers. func (k Keeper) GetAllAffiliateTiers(ctx sdk.Context) (types.AffiliateTiers, error) { store := ctx.KVStore(k.storeKey) @@ -126,29 +175,12 @@ func (k Keeper) GetAllAffiliateTiers(ctx sdk.Context) (types.AffiliateTiers, err return affiliateTiers, nil } -func (k Keeper) GetAllAffilliateOverrides(ctx sdk.Context) (types.AffiliateOverrides, error) { - store := ctx.KVStore(k.storeKey) - affiliateOverridesBytes := store.Get([]byte(types.AffiliateOverridesKey)) - - var affiliateOverrides types.AffiliateOverrides - if affiliateOverridesBytes == nil { - // Return empty overrides if not initialized. - return types.AffiliateOverrides{}, nil - } - err := k.cdc.Unmarshal(affiliateOverridesBytes, &affiliateOverrides) - if err != nil { - return affiliateOverrides, err - } - - return affiliateOverrides, nil -} - // GetTakerFeeShare returns the taker fee share for an address based on the affiliate tiers. // If the address is in the whitelist, the fee share ppm is overridden. func (k Keeper) GetTakerFeeShare( ctx sdk.Context, address string, - affiliateOverrides map[string]bool, + affiliatesWhitelistMap map[string]uint32, ) ( affiliateAddress string, feeSharePpm uint32, @@ -159,7 +191,13 @@ func (k Keeper) GetTakerFeeShare( if !exists { return "", 0, false, nil } - _, feeSharePpm, err = k.GetTierForAffiliate(ctx, affiliateAddress, affiliateOverrides) + // Override fee share ppm if the address is in the whitelist. + if _, exists := affiliatesWhitelistMap[affiliateAddress]; exists { + feeSharePpm = affiliatesWhitelistMap[affiliateAddress] + return affiliateAddress, feeSharePpm, true, nil + } + + _, feeSharePpm, err = k.GetTierForAffiliate(ctx, affiliateAddress) if err != nil { return "", 0, false, err } @@ -171,7 +209,6 @@ func (k Keeper) GetTakerFeeShare( func (k Keeper) GetTierForAffiliate( ctx sdk.Context, affiliateAddr string, - affiliateOverrides map[string]bool, ) ( tierLevel uint32, feeSharePpm uint32, @@ -180,7 +217,6 @@ func (k Keeper) GetTierForAffiliate( if err != nil { return 0, 0, err } - tiers := affiliateTiers.GetTiers() // Return 0 tier if no tiers are set. if len(tiers) == 0 { @@ -189,21 +225,9 @@ func (k Keeper) GetTierForAffiliate( numTiers := uint32(len(tiers)) maxTierLevel := numTiers - 1 currentTier := uint32(0) - - // Check whether the address is overridden, if it is then set the - // affiliate tier to the max - if affiliateOverrides != nil { - if _, exists := affiliateOverrides[affiliateAddr]; exists { - feeSharePpm = affiliateTiers.Tiers[maxTierLevel].TakerFeeSharePpm - return uint32(maxTierLevel), feeSharePpm, nil - } - } - - // Get the affiliate revenue generated in the last 30d - userStats := k.statsKeeper.GetUserStats(ctx, affiliateAddr) - referredVolume := big.NewInt(0) - if userStats != nil { - referredVolume = new(big.Int).SetUint64(userStats.Affiliate_30DReferredVolumeQuoteQuantums) + referredVolume, err := k.GetReferredVolume(ctx, affiliateAddr) + if err != nil { + return 0, 0, err } for index, tier := range tiers { @@ -251,9 +275,9 @@ func (k Keeper) UpdateAffiliateTiers(ctx sdk.Context, affiliateTiers types.Affil } // Check if the tiers are strictly increasing. if tiers[i].ReqReferredVolumeQuoteQuantums <= tiers[i-1].ReqReferredVolumeQuoteQuantums || - tiers[i].ReqStakedWholeCoins < tiers[i-1].ReqStakedWholeCoins { + tiers[i].ReqStakedWholeCoins <= tiers[i-1].ReqStakedWholeCoins { return errorsmod.Wrapf(types.ErrInvalidAffiliateTiers, - "volume must be strictly increasing; staked coins must be non-decreasing") + "tiers values must be strictly increasing") } } store.Set([]byte(types.AffiliateTiersKey), affiliateTiersBytes) @@ -268,7 +292,6 @@ func (k Keeper) GetIndexerEventManager() indexer_manager.IndexerEventManager { return k.indexerEventManager } -// Deprecated: This is deprecated in favor of AffiliateOverride. func (k Keeper) GetAffiliateWhitelistMap(ctx sdk.Context) (map[string]uint32, error) { affiliateWhitelist, err := k.GetAffiliateWhitelist(ctx) if err != nil { @@ -283,7 +306,6 @@ func (k Keeper) GetAffiliateWhitelistMap(ctx sdk.Context) (map[string]uint32, er return affiliateWhitelistMap, nil } -// Deprecated: This is deprecated in favor of AffiliateOverride. func (k Keeper) SetAffiliateWhitelist(ctx sdk.Context, whitelist types.AffiliateWhitelist) error { store := ctx.KVStore(k.storeKey) addressSet := make(map[string]bool) @@ -312,7 +334,6 @@ func (k Keeper) SetAffiliateWhitelist(ctx sdk.Context, whitelist types.Affiliate return nil } -// DO NOT USE: This will be deprecated soon. func (k Keeper) GetAffiliateWhitelist(ctx sdk.Context) (types.AffiliateWhitelist, error) { store := ctx.KVStore(k.storeKey) affiliateWhitelistBytes := store.Get([]byte(types.AffiliateWhitelistKey)) @@ -329,125 +350,12 @@ func (k Keeper) GetAffiliateWhitelist(ctx sdk.Context) (types.AffiliateWhitelist return affiliateWhitelist, nil } -func (k Keeper) UpdateAffiliateParameters( - ctx sdk.Context, - msg *types.MsgUpdateAffiliateParameters, -) error { - store := ctx.KVStore(k.storeKey) - - affiliateParametersBytes, err := k.cdc.Marshal(&msg.AffiliateParameters) - if err != nil { - return err - } - store.Set([]byte(types.AffiliateParametersKey), affiliateParametersBytes) - - return nil -} - -func (k Keeper) GetAffiliateParameters(ctx sdk.Context) (types.AffiliateParameters, error) { - store := ctx.KVStore(k.storeKey) - affiliateParametersBytes := store.Get([]byte(types.AffiliateParametersKey)) - if affiliateParametersBytes == nil { - return types.AffiliateParameters{}, nil - } - affiliateParameters := types.AffiliateParameters{} - err := k.cdc.Unmarshal(affiliateParametersBytes, &affiliateParameters) - if err != nil { - return types.AffiliateParameters{}, err - } - return affiliateParameters, nil -} - -func (k Keeper) SetAffiliateOverrides(ctx sdk.Context, overrides types.AffiliateOverrides) error { - store := ctx.KVStore(k.storeKey) - affiliateOverridesBytes, err := k.cdc.Marshal(&overrides) - if err != nil { - return err - } - store.Set([]byte(types.AffiliateOverridesKey), affiliateOverridesBytes) - return nil -} - -func (k Keeper) GetAffiliateOverrides(ctx sdk.Context) (types.AffiliateOverrides, error) { - store := ctx.KVStore(k.storeKey) - affiliateOverridesBytes := store.Get([]byte(types.AffiliateOverridesKey)) - if affiliateOverridesBytes == nil { - return types.AffiliateOverrides{}, nil - } - affiliateOverrides := types.AffiliateOverrides{} - err := k.cdc.Unmarshal(affiliateOverridesBytes, &affiliateOverrides) - if err != nil { - return types.AffiliateOverrides{}, err - } - return affiliateOverrides, nil -} - -func (k Keeper) GetAffiliateOverridesMap(ctx sdk.Context) (map[string]bool, error) { - affiliateOverrides, err := k.GetAffiliateOverrides(ctx) - if err != nil { - return nil, err - } - affiliateOverridesMap := make(map[string]bool) - for _, address := range affiliateOverrides.Addresses { - affiliateOverridesMap[address] = true - } - return affiliateOverridesMap, nil -} - -func (k Keeper) addReferredVolumeIfQualified( - ctx sdk.Context, - referee string, - referrer string, - volume uint64, - affiliateParams types.AffiliateParameters, - previouslyAttributedVolume map[string]uint64, -) error { - // Get the user stats from the referee - refereeUserStats := k.statsKeeper.GetUserStats(ctx, referee) - if refereeUserStats == nil { - return errorsmod.Wrapf(types.ErrUpdatingAffiliateReferredVolume, - "referee %s, refereeUserStats is nil", referee) - } - - previousVolume := (refereeUserStats.TakerNotional + refereeUserStats.MakerNotional + - previouslyAttributedVolume[referee]) - - // If parameter is 0 then no limit is applied - cap := affiliateParams.Maximum_30DAttributableVolumePerReferredUserQuoteQuantums - if cap != 0 { - if previousVolume >= cap { - volume = 0 - } else if previousVolume+volume > cap { - // Remainder of the volume to get them to the cap - volume = cap - previousVolume - } - } - previouslyAttributedVolume[referee] += volume - - // Add the volume to the referrer on their 30d rolling window - if volume > 0 { - affiliateUserStats := k.statsKeeper.GetUserStats(ctx, referrer) - if affiliateUserStats != nil { - affiliateUserStats.Affiliate_30DReferredVolumeQuoteQuantums += volume - } - k.statsKeeper.SetUserStats(ctx, referrer, affiliateUserStats) - } - return nil -} - func (k Keeper) AggregateAffiliateReferredVolumeForFills( ctx sdk.Context, ) error { blockStats := k.statsKeeper.GetBlockStats(ctx) - affiliateParams, err := k.GetAffiliateParameters(ctx) - if err != nil { - return err - } referredByCache := make(map[string]string) - // Multiple fills within the same block can happen, so we want to keep track of those to properly attribute volume. - previouslyAttributedVolume := make(map[string]uint64) - for _, fill := range blockStats.Fills { // Process taker's referred volume referredByAddrTaker, cached := referredByCache[fill.Taker] @@ -459,15 +367,7 @@ func (k Keeper) AggregateAffiliateReferredVolumeForFills( } } if referredByAddrTaker != "" { - // Add referred volume, this decides affiliate tier and is limited by the maximum volume on a 30d window - if err := k.addReferredVolumeIfQualified( - ctx, - fill.Taker, - referredByAddrTaker, - fill.Notional, - affiliateParams, - previouslyAttributedVolume, - ); err != nil { + if err := k.AddReferredVolume(ctx, referredByAddrTaker, lib.BigU(fill.Notional)); err != nil { return err } } @@ -482,14 +382,7 @@ func (k Keeper) AggregateAffiliateReferredVolumeForFills( } } if referredByAddrMaker != "" { - if err := k.addReferredVolumeIfQualified( - ctx, - fill.Maker, - referredByAddrMaker, - fill.Notional, - affiliateParams, - previouslyAttributedVolume, - ); err != nil { + if err := k.AddReferredVolume(ctx, referredByAddrMaker, lib.BigU(fill.Notional)); err != nil { return err } } diff --git a/protocol/x/affiliates/keeper/keeper_test.go b/protocol/x/affiliates/keeper/keeper_test.go index ad7c50157df..5a889d1f9de 100644 --- a/protocol/x/affiliates/keeper/keeper_test.go +++ b/protocol/x/affiliates/keeper/keeper_test.go @@ -129,6 +129,44 @@ func TestGetReferredByEmptyAffiliate(t *testing.T) { require.Equal(t, "", affiliate) } +func TestAddReferredVolume(t *testing.T) { + tApp := testapp.NewTestAppBuilder(t).Build() + ctx := tApp.InitChain() + k := tApp.App.AffiliatesKeeper + + affiliate := "affiliate1" + initialVolume := big.NewInt(1000) + addedVolume := big.NewInt(500) + + err := k.AddReferredVolume(ctx, affiliate, initialVolume) + require.NoError(t, err) + + volume, err := k.GetReferredVolume(ctx, affiliate) + require.NoError(t, err) + require.Equal(t, initialVolume, volume) + + err = k.AddReferredVolume(ctx, affiliate, addedVolume) + require.NoError(t, err) + + updatedVolume, err := k.GetReferredVolume(ctx, affiliate) + require.NoError(t, err) + require.Equal(t, big.NewInt(1500), updatedVolume) +} + +func TestGetReferredVolumeInvalidAffiliate(t *testing.T) { + tApp := testapp.NewTestAppBuilder(t).Build() + ctx := tApp.InitChain() + k := tApp.App.AffiliatesKeeper + + affiliate := "malformed_address" + _, exists := k.GetReferredBy(ctx, affiliate) + require.False(t, exists) + + affiliate = constants.AliceAccAddress.String() + _, exists = k.GetReferredBy(ctx, affiliate) + require.False(t, exists) +} + func TestGetTakerFeeShareViaReferredVolume(t *testing.T) { tApp := testapp.NewTestAppBuilder(t).Build() ctx := tApp.InitChain() @@ -139,14 +177,7 @@ func TestGetTakerFeeShareViaReferredVolume(t *testing.T) { require.NoError(t, err) stakingKeeper := tApp.App.StakingKeeper - require.NoError(t, k.UpdateAffiliateParameters(ctx, &types.MsgUpdateAffiliateParameters{ - Authority: constants.GovAuthority, - AffiliateParameters: types.AffiliateParameters{ - Maximum_30DAttributableVolumePerReferredUserQuoteQuantums: 100_000_000_000_000, - }, - })) - - require.NoError(t, stakingKeeper.SetDelegation(ctx, + err = stakingKeeper.SetDelegation(ctx, stakingtypes.NewDelegation(constants.AliceAccAddress.String(), constants.AliceValAddress.String(), math.LegacyNewDecFromBigInt( new(big.Int).Mul( @@ -155,7 +186,8 @@ func TestGetTakerFeeShareViaReferredVolume(t *testing.T) { ), ), ), - )) + ) + require.NoError(t, err) // Register affiliate and referee affiliate := constants.AliceAccAddress.String() @@ -164,20 +196,20 @@ func TestGetTakerFeeShareViaReferredVolume(t *testing.T) { require.NoError(t, err) // Get taker fee share for referee - affiliateAddr, feeSharePpm, exists, err := k.GetTakerFeeShare(ctx, referee, map[string]bool{}) + affiliateAddr, feeSharePpm, exists, err := k.GetTakerFeeShare(ctx, referee, map[string]uint32{}) require.NoError(t, err) require.True(t, exists) require.Equal(t, affiliate, affiliateAddr) require.Equal(t, types.DefaultAffiliateTiers.Tiers[0].TakerFeeSharePpm, feeSharePpm) - tApp.App.StatsKeeper.SetUserStats(ctx, affiliate, &statstypes.UserStats{ - TakerNotional: 100_000_000_000_000, - MakerNotional: 100_000_000_000_000, - Affiliate_30DReferredVolumeQuoteQuantums: 1_000_000_000_001, - }) + // Add more referred volume to upgrade tier + err = k.AddReferredVolume(ctx, affiliate, big.NewInt( + int64(types.DefaultAffiliateTiers.Tiers[1].ReqReferredVolumeQuoteQuantums), + )) + require.NoError(t, err) // Get updated taker fee share for referee - affiliateAddr, feeSharePpm, exists, err = k.GetTakerFeeShare(ctx, referee, map[string]bool{}) + affiliateAddr, feeSharePpm, exists, err = k.GetTakerFeeShare(ctx, referee, map[string]uint32{}) require.NoError(t, err) require.True(t, exists) require.Equal(t, affiliate, affiliateAddr) @@ -213,7 +245,7 @@ func TestGetTakerFeeShareViaStakedAmount(t *testing.T) { require.NoError(t, err) // Get taker fee share for referee - affiliateAddr, feeSharePpm, exists, err := k.GetTakerFeeShare(ctx, referee, map[string]bool{}) + affiliateAddr, feeSharePpm, exists, err := k.GetTakerFeeShare(ctx, referee, map[string]uint32{}) require.NoError(t, err) require.True(t, exists) require.Equal(t, affiliate, affiliateAddr) @@ -231,7 +263,7 @@ func TestGetTakerFeeShareViaStakedAmount(t *testing.T) { )))) require.NoError(t, err) // Get updated taker fee share for referee - affiliateAddr, feeSharePpm, exists, err = k.GetTakerFeeShare(ctx, referee, map[string]bool{}) + affiliateAddr, feeSharePpm, exists, err = k.GetTakerFeeShare(ctx, referee, map[string]uint32{}) require.NoError(t, err) require.True(t, exists) require.Equal(t, affiliate, affiliateAddr) @@ -267,11 +299,9 @@ func TestGetTierForAffiliate_VolumeAndStake(t *testing.T) { err = k.RegisterAffiliate(ctx, referee, affiliate) require.NoError(t, err) - tApp.App.StatsKeeper.SetUserStats(ctx, affiliate, &statstypes.UserStats{ - TakerNotional: 100_000_000_000_000, - MakerNotional: 100_000_000_000_000, - Affiliate_30DReferredVolumeQuoteQuantums: affiliateTiers.Tiers[2].ReqReferredVolumeQuoteQuantums, - }) + reqReferredVolume := big.NewInt(int64(affiliateTiers.Tiers[2].ReqReferredVolumeQuoteQuantums)) + err = k.AddReferredVolume(ctx, affiliate, reqReferredVolume) + require.NoError(t, err) stakedAmount := new(big.Int).Mul( big.NewInt(int64(affiliateTiers.Tiers[3].ReqStakedWholeCoins)), @@ -285,7 +315,7 @@ func TestGetTierForAffiliate_VolumeAndStake(t *testing.T) { ) require.NoError(t, err) - tierLevel, feeSharePpm, err := k.GetTierForAffiliate(ctx, affiliate, map[string]bool{}) + tierLevel, feeSharePpm, err := k.GetTierForAffiliate(ctx, affiliate) require.NoError(t, err) require.Equal(t, uint32(3), tierLevel) @@ -594,7 +624,7 @@ func TestGetTakerFeeShareViaWhitelist(t *testing.T) { name string affiliateAddr string refereeAddr string - overrides *types.AffiliateOverrides + whitelist *types.AffiliateWhitelist expectedFeeSharePpm uint32 expectedExists bool }{ @@ -602,17 +632,22 @@ func TestGetTakerFeeShareViaWhitelist(t *testing.T) { name: "Affiliate in whitelist", affiliateAddr: constants.AliceAccAddress.String(), refereeAddr: constants.BobAccAddress.String(), - overrides: &types.AffiliateOverrides{ - Addresses: []string{constants.AliceAccAddress.String()}, + whitelist: &types.AffiliateWhitelist{ + Tiers: []types.AffiliateWhitelist_Tier{ + { + Addresses: []string{constants.AliceAccAddress.String()}, + TakerFeeSharePpm: 400_000, // 40% + }, + }, }, - expectedFeeSharePpm: 250_000, // 25% + expectedFeeSharePpm: 400_000, // 40% expectedExists: true, }, { name: "Affiliate not in whitelist", affiliateAddr: constants.AliceAccAddress.String(), refereeAddr: constants.BobAccAddress.String(), - overrides: &types.AffiliateOverrides{}, + whitelist: &types.AffiliateWhitelist{}, expectedFeeSharePpm: tiers.Tiers[0].TakerFeeSharePpm, expectedExists: true, }, @@ -620,8 +655,13 @@ func TestGetTakerFeeShareViaWhitelist(t *testing.T) { name: "Referee not registered", affiliateAddr: "", refereeAddr: constants.BobAccAddress.String(), - overrides: &types.AffiliateOverrides{ - Addresses: []string{constants.AliceAccAddress.String()}, + whitelist: &types.AffiliateWhitelist{ + Tiers: []types.AffiliateWhitelist_Tier{ + { + Addresses: []string{constants.AliceAccAddress.String()}, + TakerFeeSharePpm: 400_000, // 40% + }, + }, }, expectedFeeSharePpm: 0, expectedExists: false, @@ -634,18 +674,18 @@ func TestGetTakerFeeShareViaWhitelist(t *testing.T) { err := k.UpdateAffiliateTiers(ctx, tiers) require.NoError(t, err) - if tc.overrides != nil { - err := k.SetAffiliateOverrides(ctx, *tc.overrides) + if tc.whitelist != nil { + err := k.SetAffiliateWhitelist(ctx, *tc.whitelist) require.NoError(t, err) } if tc.affiliateAddr != "" { err := k.RegisterAffiliate(ctx, tc.refereeAddr, tc.affiliateAddr) require.NoError(t, err) } - affiliateOverridesMap, err := k.GetAffiliateOverridesMap(ctx) + affiliateWhitelistMap, err := k.GetAffiliateWhitelistMap(ctx) require.NoError(t, err) - affiliateAddr, feeSharePpm, exists, err := k.GetTakerFeeShare(ctx, tc.refereeAddr, affiliateOverridesMap) + affiliateAddr, feeSharePpm, exists, err := k.GetTakerFeeShare(ctx, tc.refereeAddr, affiliateWhitelistMap) require.NoError(t, err) require.Equal(t, tc.affiliateAddr, affiliateAddr) require.Equal(t, tc.expectedFeeSharePpm, feeSharePpm) @@ -660,20 +700,14 @@ func TestAggregateAffiliateReferredVolumeForFills(t *testing.T) { referee2 := constants.DaveAccAddress.String() maker := constants.CarlAccAddress.String() testCases := []struct { - name string - referrals int - expectedVolume *big.Int - referreeAddressesToVerify []string - expectedCommissions []*big.Int - expectedReferrer []string - expectedAttributedVolume []uint64 - setup func(t *testing.T, ctx sdk.Context, k *keeper.Keeper, statsKeeper *statskeeper.Keeper) + name string + referrals int + expectedVolume *big.Int + setup func(t *testing.T, ctx sdk.Context, k *keeper.Keeper, statsKeeper *statskeeper.Keeper) }{ { - name: "0 referrals", - expectedVolume: big.NewInt(0), - expectedReferrer: []string{}, - expectedAttributedVolume: []uint64{}, + name: "0 referrals", + expectedVolume: big.NewInt(0), setup: func(t *testing.T, ctx sdk.Context, k *keeper.Keeper, statsKeeper *statskeeper.Keeper) { statsKeeper.SetBlockStats(ctx, &statstypes.BlockStats{ Fills: []*statstypes.BlockStats_Fill{ @@ -690,73 +724,40 @@ func TestAggregateAffiliateReferredVolumeForFills(t *testing.T) { name: "1 referral", referrals: 1, expectedVolume: big.NewInt(100_000_000_000), - expectedReferrer: []string{ - affiliate, - }, - expectedAttributedVolume: []uint64{ - 200_000_000_000, - }, setup: func(t *testing.T, ctx sdk.Context, k *keeper.Keeper, statsKeeper *statskeeper.Keeper) { err := k.RegisterAffiliate(ctx, referee1, affiliate) require.NoError(t, err) - - // They are close to the maximum of attributable volume so we should not add more than expected - statsKeeper.SetUserStats(ctx, affiliate, &statstypes.UserStats{ - TakerNotional: 0, - MakerNotional: 0, - Affiliate_30DRevenueGeneratedQuantums: 0, - Affiliate_30DReferredVolumeQuoteQuantums: 100_000_000_000, - }) - statsKeeper.SetBlockStats(ctx, &statstypes.BlockStats{ Fills: []*statstypes.BlockStats_Fill{ { - Taker: referee1, - Maker: maker, - Notional: 100_000_000_000, - AffiliateFeeGeneratedQuantums: 1_000_000_000, + Taker: referee1, + Maker: maker, + Notional: 100_000_000_000, }, }, }) }, }, { - name: "2 referrals, no limit", + name: "2 referrals", referrals: 2, expectedVolume: big.NewInt(300_000_000_000), - expectedReferrer: []string{ - affiliate, - }, - expectedAttributedVolume: []uint64{ - 300_000_000_000, - }, setup: func(t *testing.T, ctx sdk.Context, k *keeper.Keeper, statsKeeper *statskeeper.Keeper) { err := k.RegisterAffiliate(ctx, referee1, affiliate) require.NoError(t, err) err = k.RegisterAffiliate(ctx, referee2, affiliate) require.NoError(t, err) - - // They are close to the maximum of attributable volume so we should not add more than expected - statsKeeper.SetUserStats(ctx, affiliate, &statstypes.UserStats{ - TakerNotional: 0, - MakerNotional: 0, - Affiliate_30DRevenueGeneratedQuantums: 0, - Affiliate_30DReferredVolumeQuoteQuantums: 0, - }) - statsKeeper.SetBlockStats(ctx, &statstypes.BlockStats{ Fills: []*statstypes.BlockStats_Fill{ { - Taker: referee1, - Maker: maker, - Notional: 100_000_000_000, - AffiliateFeeGeneratedQuantums: 1_000_000_000, + Taker: referee1, + Maker: maker, + Notional: 100_000_000_000, }, { - Taker: referee2, - Maker: maker, - Notional: 200_000_000_000, - AffiliateFeeGeneratedQuantums: 2_000_000_000, + Taker: referee2, + Maker: maker, + Notional: 200_000_000_000, }, }, }) @@ -766,12 +767,6 @@ func TestAggregateAffiliateReferredVolumeForFills(t *testing.T) { name: "2 referrals, maker also referred", referrals: 2, expectedVolume: big.NewInt(600_000_000_000), - expectedReferrer: []string{ - affiliate, - }, - expectedAttributedVolume: []uint64{ - 600_000_000_000, - }, setup: func(t *testing.T, ctx sdk.Context, k *keeper.Keeper, statsKeeper *statskeeper.Keeper) { err := k.RegisterAffiliate(ctx, referee1, affiliate) require.NoError(t, err) @@ -782,264 +777,40 @@ func TestAggregateAffiliateReferredVolumeForFills(t *testing.T) { statsKeeper.SetBlockStats(ctx, &statstypes.BlockStats{ Fills: []*statstypes.BlockStats_Fill{ { - Taker: referee1, - Maker: maker, - Notional: 100_000_000_000, - AffiliateFeeGeneratedQuantums: 1_000_000_000, + Taker: referee1, + Maker: maker, + Notional: 100_000_000_000, }, { - Taker: referee2, - Maker: maker, - Notional: 200_000_000_000, - AffiliateFeeGeneratedQuantums: 3_000_000_000, + Taker: referee2, + Maker: maker, + Notional: 200_000_000_000, }, }, }) - err = k.UpdateAffiliateParameters(ctx, &types.MsgUpdateAffiliateParameters{ - Authority: constants.GovAuthority, - AffiliateParameters: types.AffiliateParameters{ - Maximum_30DAttributableVolumePerReferredUserQuoteQuantums: 800_000_000_000, - }, - }) - require.NoError(t, err) }, }, { name: "2 referrals, takers not referred, maker referred", referrals: 2, expectedVolume: big.NewInt(300_000_000_000), - expectedReferrer: []string{ - affiliate, - }, - expectedAttributedVolume: []uint64{ - 200_000_000_000, - }, setup: func(t *testing.T, ctx sdk.Context, k *keeper.Keeper, statsKeeper *statskeeper.Keeper) { err := k.RegisterAffiliate(ctx, maker, affiliate) require.NoError(t, err) - - // They are close to the maximum of attributable volume so we should not add more than expected - statsKeeper.SetUserStats(ctx, affiliate, &statstypes.UserStats{ - TakerNotional: 0, - MakerNotional: 0, - Affiliate_30DRevenueGeneratedQuantums: 0, - Affiliate_30DReferredVolumeQuoteQuantums: 0, - }) - statsKeeper.SetBlockStats(ctx, &statstypes.BlockStats{ Fills: []*statstypes.BlockStats_Fill{ { - Taker: referee1, - Maker: maker, - Notional: 100_000_000_000, - AffiliateFeeGeneratedQuantums: 1_000_000_000, - }, - { - Taker: referee2, - Maker: maker, - Notional: 100_000_000_000, - AffiliateFeeGeneratedQuantums: 2_000_000_000, - }, - }, - }) - err = k.UpdateAffiliateParameters(ctx, &types.MsgUpdateAffiliateParameters{ - Authority: constants.GovAuthority, - AffiliateParameters: types.AffiliateParameters{ - Maximum_30DAttributableVolumePerReferredUserQuoteQuantums: 300_000_000_000, - }, - }) - require.NoError(t, err) - }, - }, - { - name: "2 referrals, reached maximum attributable revenue", - referrals: 2, - expectedVolume: big.NewInt(300_000_000_000), - expectedReferrer: []string{ - affiliate, - }, - expectedAttributedVolume: []uint64{ - 80_000_000_000, - }, - setup: func(t *testing.T, ctx sdk.Context, k *keeper.Keeper, statsKeeper *statskeeper.Keeper) { - err := k.RegisterAffiliate(ctx, referee1, affiliate) - require.NoError(t, err) - err = k.RegisterAffiliate(ctx, referee2, affiliate) - require.NoError(t, err) - - // They are close to the maximum of attributable volume so we should not add more than expected - statsKeeper.SetUserStats(ctx, affiliate, &statstypes.UserStats{ - TakerNotional: 0, - MakerNotional: 0, - Affiliate_30DRevenueGeneratedQuantums: 0, - Affiliate_30DReferredVolumeQuoteQuantums: 0, - }) - - // Maximum volume was reached per affiliate, so we should not add any attributable volume - statsKeeper.SetUserStats(ctx, referee1, &statstypes.UserStats{ - TakerNotional: 150_000_000_000, - MakerNotional: 100_000_000_000, - }) - statsKeeper.SetUserStats(ctx, referee2, &statstypes.UserStats{ - TakerNotional: 150_000_000_000, - MakerNotional: 100_000_000_000, - }) - - statsKeeper.SetBlockStats(ctx, &statstypes.BlockStats{ - Fills: []*statstypes.BlockStats_Fill{ - { - Taker: referee1, - Maker: maker, - Notional: 100_000_000_000, - AffiliateFeeGeneratedQuantums: 1_000_000_000, - }, - { - Taker: referee2, - Maker: maker, - Notional: 200_000_000_000, - AffiliateFeeGeneratedQuantums: 2_000_000_000, - }, - }, - }) - err = k.UpdateAffiliateParameters(ctx, &types.MsgUpdateAffiliateParameters{ - Authority: constants.GovAuthority, - AffiliateParameters: types.AffiliateParameters{ - Maximum_30DAttributableVolumePerReferredUserQuoteQuantums: 290_000_000_000, - }, - }) - require.NoError(t, err) - }, - }, - { - name: "2 referrals, test limits of attributable revenue", - referrals: 2, - expectedVolume: big.NewInt(300_000_000_000), - expectedReferrer: []string{ - affiliate, - }, - expectedAttributedVolume: []uint64{ - 200_000_000_000, - }, - setup: func(t *testing.T, ctx sdk.Context, k *keeper.Keeper, statsKeeper *statskeeper.Keeper) { - err := k.RegisterAffiliate(ctx, referee1, affiliate) - require.NoError(t, err) - err = k.RegisterAffiliate(ctx, referee2, affiliate) - require.NoError(t, err) - - // They are close to the maximum of attributable volume so we should not add more than expected - statsKeeper.SetUserStats(ctx, affiliate, &statstypes.UserStats{ - TakerNotional: 0, - MakerNotional: 0, - Affiliate_30DRevenueGeneratedQuantums: 0, - Affiliate_30DReferredVolumeQuoteQuantums: 0, - }) - - // They are close to the maximum of attributable volume so we should not add more than expected - statsKeeper.SetUserStats(ctx, referee1, &statstypes.UserStats{ - TakerNotional: 50_000_000_000, - MakerNotional: 100_000_000_000, - Affiliate_30DRevenueGeneratedQuantums: 1_000_000_000, - }) - statsKeeper.SetUserStats(ctx, referee2, &statstypes.UserStats{ - TakerNotional: 50_000_000_000, - MakerNotional: 100_000_000_000, - Affiliate_30DRevenueGeneratedQuantums: 1_000_000_000, - }) - - statsKeeper.SetBlockStats(ctx, &statstypes.BlockStats{ - Fills: []*statstypes.BlockStats_Fill{ - { - Taker: referee1, - Maker: maker, - Notional: 100_000_000_000, - AffiliateFeeGeneratedQuantums: 1_000_000_000, - }, - { - Taker: referee2, - Maker: maker, - Notional: 200_000_000_000, - AffiliateFeeGeneratedQuantums: 2_000_000_000, - }, - }, - }) - err = k.UpdateAffiliateParameters(ctx, &types.MsgUpdateAffiliateParameters{ - Authority: constants.GovAuthority, - AffiliateParameters: types.AffiliateParameters{ - // Each affiliate can only generate 250_000_000_000 quantums of attributable revenue on a 30d window - Maximum_30DAttributableVolumePerReferredUserQuoteQuantums: 250_000_000_000, - }, - }) - require.NoError(t, err) - }, - }, - { - name: "maker is also affiliate, make sure attributed volume doesn't exceed max per user", - referrals: 2, - expectedVolume: big.NewInt(600_000_000_000), - expectedReferrer: []string{ - affiliate, - }, - expectedAttributedVolume: []uint64{ - 350_000_000_000, - }, - setup: func(t *testing.T, ctx sdk.Context, k *keeper.Keeper, statsKeeper *statskeeper.Keeper) { - err := k.RegisterAffiliate(ctx, referee1, affiliate) - require.NoError(t, err) - err = k.RegisterAffiliate(ctx, referee2, affiliate) - require.NoError(t, err) - err = k.RegisterAffiliate(ctx, maker, affiliate) - require.NoError(t, err) - - // They are close to the maximum of attributable volume so we should not add more than expected - statsKeeper.SetUserStats(ctx, affiliate, &statstypes.UserStats{ - TakerNotional: 0, - MakerNotional: 0, - Affiliate_30DRevenueGeneratedQuantums: 0, - Affiliate_30DReferredVolumeQuoteQuantums: 0, - }) - // Starts with 150M volume - statsKeeper.SetUserStats(ctx, referee1, &statstypes.UserStats{ - TakerNotional: 50_000_000_000, - MakerNotional: 100_000_000_000, - Affiliate_30DRevenueGeneratedQuantums: 1_000_000_000, - }) - // starts with 150M volume - statsKeeper.SetUserStats(ctx, referee2, &statstypes.UserStats{ - TakerNotional: 50_000_000_000, - MakerNotional: 100_000_000_000, - Affiliate_30DRevenueGeneratedQuantums: 1_000_000_000, - }) - // Starts with 100M volume - statsKeeper.SetUserStats(ctx, maker, &statstypes.UserStats{ - TakerNotional: 50_000_000_000, - MakerNotional: 50_000_000_000, - Affiliate_30DRevenueGeneratedQuantums: 1_000_000_000, - }) - - statsKeeper.SetBlockStats(ctx, &statstypes.BlockStats{ - Fills: []*statstypes.BlockStats_Fill{ - { - Taker: referee1, - Maker: maker, - Notional: 100_000_000_000, - AffiliateFeeGeneratedQuantums: 1_000_000_000, + Taker: referee1, + Maker: maker, + Notional: 100_000_000_000, }, { - Taker: referee2, - Maker: maker, - Notional: 200_000_000_000, - AffiliateFeeGeneratedQuantums: 2_000_000_000, + Taker: referee2, + Maker: maker, + Notional: 200_000_000_000, }, }, }) - err = k.UpdateAffiliateParameters(ctx, &types.MsgUpdateAffiliateParameters{ - Authority: constants.GovAuthority, - AffiliateParameters: types.AffiliateParameters{ - // Each affiliate can only generate 250_000_000_000 quantums of attributable revenue on a 30d window - Maximum_30DAttributableVolumePerReferredUserQuoteQuantums: 250_000_000_000, - }, - }) - require.NoError(t, err) }, }, } @@ -1059,12 +830,9 @@ func TestAggregateAffiliateReferredVolumeForFills(t *testing.T) { err = k.AggregateAffiliateReferredVolumeForFills(ctx) require.NoError(t, err) - for idx := range tc.expectedReferrer { - referrer := tc.expectedReferrer[idx] - referrerUser := statsKeeper.GetUserStats(ctx, referrer) - require.NoError(t, err) - require.Equal(t, tc.expectedAttributedVolume[idx], referrerUser.Affiliate_30DReferredVolumeQuoteQuantums) - } + referredVolume, err := k.GetReferredVolume(ctx, affiliate) + require.NoError(t, err) + require.Equal(t, tc.expectedVolume, referredVolume) }) } } @@ -1074,55 +842,8 @@ func TestGetTierForAffiliateEmptyTiers(t *testing.T) { ctx := tApp.InitChain() k := tApp.App.AffiliatesKeeper - tierLevel, feeSharePpm, err := k.GetTierForAffiliate(ctx, constants.AliceAccAddress.String(), map[string]bool{}) + tierLevel, feeSharePpm, err := k.GetTierForAffiliate(ctx, constants.AliceAccAddress.String()) require.NoError(t, err) require.Equal(t, uint32(0), tierLevel) require.Equal(t, uint32(0), feeSharePpm) } - -func TestUpdateAffiliateParameters(t *testing.T) { - tApp := testapp.NewTestAppBuilder(t).Build() - ctx := tApp.InitChain() - k := tApp.App.AffiliatesKeeper - - err := k.UpdateAffiliateParameters(ctx, &types.MsgUpdateAffiliateParameters{ - Authority: constants.GovAuthority, - AffiliateParameters: types.DefaultAffiliateParameters, - }) - require.NoError(t, err) - - affiliateParameters, err := k.GetAffiliateParameters(ctx) - require.NoError(t, err) - require.Equal( - t, - uint64(100_000_000_000_000), - affiliateParameters.GetMaximum_30DAttributableVolumePerReferredUserQuoteQuantums(), - ) - require.Equal(t, uint32(2), affiliateParameters.GetRefereeMinimumFeeTierIdx()) - require.Equal( - t, - uint64(10_000_000_000), - affiliateParameters.GetMaximum_30DAffiliateRevenuePerReferredUserQuoteQuantums(), - ) -} - -func TestGetTierForAffiliateOverrides(t *testing.T) { - tApp := testapp.NewTestAppBuilder(t).Build() - ctx := tApp.InitChain() - k := tApp.App.AffiliatesKeeper - - err := k.UpdateAffiliateTiers(ctx, types.DefaultAffiliateTiers) - require.NoError(t, err) - - tierLevel, feeSharePpm, err := k.GetTierForAffiliate(ctx, constants.AliceAccAddress.String(), map[string]bool{}) - require.NoError(t, err) - require.Equal(t, uint32(3), tierLevel) - require.Equal(t, uint32(150_000), feeSharePpm) - - tierLevel, feeSharePpm, err = k.GetTierForAffiliate(ctx, constants.AliceAccAddress.String(), map[string]bool{ - constants.AliceAccAddress.String(): true, - }) - require.NoError(t, err) - require.Equal(t, uint32(4), tierLevel) - require.Equal(t, uint32(250_000), feeSharePpm) -} diff --git a/protocol/x/affiliates/keeper/msg_server.go b/protocol/x/affiliates/keeper/msg_server.go index 25cc636ad64..f1c535c6e5b 100644 --- a/protocol/x/affiliates/keeper/msg_server.go +++ b/protocol/x/affiliates/keeper/msg_server.go @@ -60,34 +60,6 @@ func (k msgServer) UpdateAffiliateWhitelist(ctx context.Context, return &types.MsgUpdateAffiliateWhitelistResponse{}, nil } -func (k msgServer) UpdateAffiliateParameters(ctx context.Context, - msg *types.MsgUpdateAffiliateParameters) (*types.MsgUpdateAffiliateParametersResponse, error) { - if !k.Keeper.HasAuthority(msg.Authority) { - return nil, errors.New("invalid authority") - } - - err := k.Keeper.UpdateAffiliateParameters(sdk.UnwrapSDKContext(ctx), msg) - if err != nil { - return nil, err - } - - return &types.MsgUpdateAffiliateParametersResponse{}, nil -} - -func (k msgServer) UpdateAffiliateOverrides(ctx context.Context, - msg *types.MsgUpdateAffiliateOverrides) (*types.MsgUpdateAffiliateOverridesResponse, error) { - if !k.Keeper.HasAuthority(msg.Authority) { - return nil, errors.New("invalid authority") - } - - err := k.Keeper.SetAffiliateOverrides(sdk.UnwrapSDKContext(ctx), msg.AffiliateOverrides) - if err != nil { - return nil, err - } - - return &types.MsgUpdateAffiliateOverridesResponse{}, nil -} - // NewMsgServerImpl returns an implementation of the MsgServer interface // for the provided Keeper. func NewMsgServerImpl(keeper Keeper) types.MsgServer { diff --git a/protocol/x/affiliates/types/affiliates.pb.go b/protocol/x/affiliates/types/affiliates.pb.go index 4389973ae20..66011198889 100644 --- a/protocol/x/affiliates/types/affiliates.pb.go +++ b/protocol/x/affiliates/types/affiliates.pb.go @@ -5,7 +5,6 @@ package types import ( fmt "fmt" - _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -237,126 +236,11 @@ func (m *AffiliateWhitelist_Tier) GetTakerFeeSharePpm() uint32 { return 0 } -// AffiliateParameters defines the parameters for the affiliate program. -type AffiliateParameters struct { - // Maximum attributable volume for a referred user in a 30d rolling window in - // notional - Maximum_30DAttributableVolumePerReferredUserQuoteQuantums uint64 `protobuf:"varint,1,opt,name=maximum_30d_attributable_volume_per_referred_user_quote_quantums,json=maximum30dAttributableVolumePerReferredUserQuoteQuantums,proto3" json:"maximum_30d_attributable_volume_per_referred_user_quote_quantums,omitempty"` - // Referred user automatically gets set to this fee tier - RefereeMinimumFeeTierIdx uint32 `protobuf:"varint,2,opt,name=referee_minimum_fee_tier_idx,json=refereeMinimumFeeTierIdx,proto3" json:"referee_minimum_fee_tier_idx,omitempty"` - // Maximum affiliate revenue for a referred user in a 30d rolling window in - // quote quantums - Maximum_30DAffiliateRevenuePerReferredUserQuoteQuantums uint64 `protobuf:"varint,3,opt,name=maximum_30d_affiliate_revenue_per_referred_user_quote_quantums,json=maximum30dAffiliateRevenuePerReferredUserQuoteQuantums,proto3" json:"maximum_30d_affiliate_revenue_per_referred_user_quote_quantums,omitempty"` -} - -func (m *AffiliateParameters) Reset() { *m = AffiliateParameters{} } -func (m *AffiliateParameters) String() string { return proto.CompactTextString(m) } -func (*AffiliateParameters) ProtoMessage() {} -func (*AffiliateParameters) Descriptor() ([]byte, []int) { - return fileDescriptor_7de5ba9c426e9350, []int{2} -} -func (m *AffiliateParameters) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AffiliateParameters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AffiliateParameters.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AffiliateParameters) XXX_Merge(src proto.Message) { - xxx_messageInfo_AffiliateParameters.Merge(m, src) -} -func (m *AffiliateParameters) XXX_Size() int { - return m.Size() -} -func (m *AffiliateParameters) XXX_DiscardUnknown() { - xxx_messageInfo_AffiliateParameters.DiscardUnknown(m) -} - -var xxx_messageInfo_AffiliateParameters proto.InternalMessageInfo - -func (m *AffiliateParameters) GetMaximum_30DAttributableVolumePerReferredUserQuoteQuantums() uint64 { - if m != nil { - return m.Maximum_30DAttributableVolumePerReferredUserQuoteQuantums - } - return 0 -} - -func (m *AffiliateParameters) GetRefereeMinimumFeeTierIdx() uint32 { - if m != nil { - return m.RefereeMinimumFeeTierIdx - } - return 0 -} - -func (m *AffiliateParameters) GetMaximum_30DAffiliateRevenuePerReferredUserQuoteQuantums() uint64 { - if m != nil { - return m.Maximum_30DAffiliateRevenuePerReferredUserQuoteQuantums - } - return 0 -} - -// AffiliateOverrides defines the affiliate whitelist. -type AffiliateOverrides struct { - // List of unique whitelisted addresses. - // These are automatically put at the maximum affiliate tier - Addresses []string `protobuf:"bytes,1,rep,name=addresses,proto3" json:"addresses,omitempty"` -} - -func (m *AffiliateOverrides) Reset() { *m = AffiliateOverrides{} } -func (m *AffiliateOverrides) String() string { return proto.CompactTextString(m) } -func (*AffiliateOverrides) ProtoMessage() {} -func (*AffiliateOverrides) Descriptor() ([]byte, []int) { - return fileDescriptor_7de5ba9c426e9350, []int{3} -} -func (m *AffiliateOverrides) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AffiliateOverrides) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AffiliateOverrides.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AffiliateOverrides) XXX_Merge(src proto.Message) { - xxx_messageInfo_AffiliateOverrides.Merge(m, src) -} -func (m *AffiliateOverrides) XXX_Size() int { - return m.Size() -} -func (m *AffiliateOverrides) XXX_DiscardUnknown() { - xxx_messageInfo_AffiliateOverrides.DiscardUnknown(m) -} - -var xxx_messageInfo_AffiliateOverrides proto.InternalMessageInfo - -func (m *AffiliateOverrides) GetAddresses() []string { - if m != nil { - return m.Addresses - } - return nil -} - func init() { proto.RegisterType((*AffiliateTiers)(nil), "dydxprotocol.affiliates.AffiliateTiers") proto.RegisterType((*AffiliateTiers_Tier)(nil), "dydxprotocol.affiliates.AffiliateTiers.Tier") proto.RegisterType((*AffiliateWhitelist)(nil), "dydxprotocol.affiliates.AffiliateWhitelist") proto.RegisterType((*AffiliateWhitelist_Tier)(nil), "dydxprotocol.affiliates.AffiliateWhitelist.Tier") - proto.RegisterType((*AffiliateParameters)(nil), "dydxprotocol.affiliates.AffiliateParameters") - proto.RegisterType((*AffiliateOverrides)(nil), "dydxprotocol.affiliates.AffiliateOverrides") } func init() { @@ -364,43 +248,31 @@ func init() { } var fileDescriptor_7de5ba9c426e9350 = []byte{ - // 561 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x41, 0x6b, 0x13, 0x41, - 0x14, 0xce, 0xa6, 0x51, 0xe8, 0x88, 0x22, 0x9b, 0xa2, 0x31, 0x94, 0xb5, 0xe4, 0x94, 0x83, 0xd9, - 0x04, 0x23, 0xc5, 0x83, 0x14, 0x13, 0xa1, 0xa8, 0x54, 0x4c, 0x37, 0xda, 0x82, 0x97, 0x61, 0x92, - 0x7d, 0x49, 0x06, 0x77, 0x76, 0x36, 0x33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 0x9a, 0xf3, 0x22, 0x49, 0x39, 0x04, 0x73, 0xbf, 0x9e, 0xf9, 0x53, 0xfb, - 0x3d, 0x3a, 0x58, 0xd3, 0xb0, 0xd0, 0x89, 0x05, 0x4c, 0x20, 0x8c, 0xff, 0x43, 0xc1, 0x96, 0x51, - 0xb0, 0x9f, 0x51, 0xb0, 0xe0, 0xf0, 0x12, 0x8a, 0xbf, 0xf5, 0x5f, 0x39, 0xca, 0xdc, 0x8a, 0x97, - 0x13, 0x10, 0x82, 0xfa, 0x20, 0xed, 0xfd, 0x3f, 0xfc, 0x6b, 0x97, 0xbe, 0x7d, 0xae, 0xed, 0xa4, - 0x7f, 0x5f, 0x2b, 0xc1, 0xba, 0x4a, 0xd0, 0x70, 0x98, 0x71, 0xb6, 0x7d, 0x72, 0x3e, 0x73, 0xac, - 0x8b, 0x99, 0x63, 0xfd, 0x9a, 0x39, 0xd6, 0xc7, 0xb9, 0x93, 0xbb, 0x98, 0x3b, 0xb9, 0xef, 0x73, - 0x27, 0xf7, 0xe6, 0xd1, 0x90, 0xaa, 0x51, 0xdc, 0x73, 0xfb, 0x9c, 0xd5, 0xd7, 0xde, 0x84, 0xc9, - 0x83, 0x5a, 0x7f, 0x44, 0x68, 0x58, 0x5f, 0x46, 0xa6, 0xd9, 0x77, 0x42, 0x9d, 0x45, 0x20, 0x7b, - 0x57, 0x0d, 0xd8, 0xfc, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x10, 0x28, 0x41, 0x19, 0x4f, 0x04, 0x00, - 0x00, + // 384 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x4f, 0x6b, 0xe2, 0x40, + 0x18, 0xc6, 0x33, 0xea, 0x2e, 0x38, 0xcb, 0x2e, 0x4b, 0x5c, 0x76, 0x45, 0x96, 0xac, 0x78, 0xca, + 0x61, 0x4d, 0x96, 0x75, 0x8f, 0x7b, 0x59, 0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x42, 0x16, 0x01, + 0xf1, 0x18, 0x1d, 0x89, 0x6a, 0xa1, 0x8e, 0xcc, 0x8f, 0x4e, 0x85, 0x43, 0xda, 0xcd, 0x61, 0x5f, + 0xb1, 0xff, 0x0a, 0xe9, 0x4d, 0x5c, 0x51, 0x12, 0x27, 0x01, 0x00, 0x11, 0xa1, 0xcb, 0x81, 0x24, + 0x49, 0x5c, 0x2d, 0xe6, 0x1b, 0x9f, 0x73, 0x74, 0x02, 0xd0, 0x55, 0xe0, 0x22, 0x89, 0x1b, 0x0f, + 0x08, 0xeb, 0x9b, 0xbf, 0xeb, 0x87, 0x54, 0x42, 0x44, 0x85, 0xd4, 0xcf, 0xf7, 0x9b, 0xf9, 0xf5, + 0x76, 0x33, 0x9b, 0xdd, 0x03, 0xed, 0x74, 0xd7, 0xe5, 0x7c, 0xc7, 0x65, 0xd7, 0xf7, 0x39, 0x08, + 0x01, 0xab, 0xe4, 0xb2, 0xb3, 0x15, 0x8e, 0xdd, 0xbc, 0x70, 0xf8, 0xe6, 0xed, 0xde, 0x6c, 0x61, + 0xa0, 0xf9, 0xc2, 0x40, 0xcf, 0x0b, 0x03, 0xdd, 0x2e, 0x0d, 0x6d, 0xbe, 0x34, 0xb4, 0xc7, 0xa5, + 0xa1, 0x5d, 0xfd, 0x1d, 0x52, 0x19, 0x66, 0x03, 0xcb, 0x63, 0xb1, 0xbd, 0xf7, 0x9a, 0xc6, 0x7f, + 0x9a, 0x5e, 0xe8, 0xd2, 0x91, 0xbd, 0x51, 0x26, 0xbb, 0x2f, 0x4c, 0x4e, 0x13, 0x10, 0x83, 0xf7, + 0x39, 0x6c, 0xbd, 0x04, 0x00, 0x00, 0xff, 0xff, 0xc7, 0x32, 0xb9, 0x71, 0x89, 0x02, 0x00, 0x00, } func (m *AffiliateTiers) Marshal() (dAtA []byte, err error) { @@ -552,76 +424,6 @@ func (m *AffiliateWhitelist_Tier) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *AffiliateParameters) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AffiliateParameters) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AffiliateParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Maximum_30DAffiliateRevenuePerReferredUserQuoteQuantums != 0 { - i = encodeVarintAffiliates(dAtA, i, uint64(m.Maximum_30DAffiliateRevenuePerReferredUserQuoteQuantums)) - i-- - dAtA[i] = 0x18 - } - if m.RefereeMinimumFeeTierIdx != 0 { - i = encodeVarintAffiliates(dAtA, i, uint64(m.RefereeMinimumFeeTierIdx)) - i-- - dAtA[i] = 0x10 - } - if m.Maximum_30DAttributableVolumePerReferredUserQuoteQuantums != 0 { - i = encodeVarintAffiliates(dAtA, i, uint64(m.Maximum_30DAttributableVolumePerReferredUserQuoteQuantums)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *AffiliateOverrides) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AffiliateOverrides) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AffiliateOverrides) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Addresses) > 0 { - for iNdEx := len(m.Addresses) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Addresses[iNdEx]) - copy(dAtA[i:], m.Addresses[iNdEx]) - i = encodeVarintAffiliates(dAtA, i, uint64(len(m.Addresses[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - func encodeVarintAffiliates(dAtA []byte, offset int, v uint64) int { offset -= sovAffiliates(v) base := offset @@ -699,39 +501,6 @@ func (m *AffiliateWhitelist_Tier) Size() (n int) { return n } -func (m *AffiliateParameters) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Maximum_30DAttributableVolumePerReferredUserQuoteQuantums != 0 { - n += 1 + sovAffiliates(uint64(m.Maximum_30DAttributableVolumePerReferredUserQuoteQuantums)) - } - if m.RefereeMinimumFeeTierIdx != 0 { - n += 1 + sovAffiliates(uint64(m.RefereeMinimumFeeTierIdx)) - } - if m.Maximum_30DAffiliateRevenuePerReferredUserQuoteQuantums != 0 { - n += 1 + sovAffiliates(uint64(m.Maximum_30DAffiliateRevenuePerReferredUserQuoteQuantums)) - } - return n -} - -func (m *AffiliateOverrides) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Addresses) > 0 { - for _, s := range m.Addresses { - l = len(s) - n += 1 + l + sovAffiliates(uint64(l)) - } - } - return n -} - func sovAffiliates(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1114,195 +883,6 @@ func (m *AffiliateWhitelist_Tier) Unmarshal(dAtA []byte) error { } return nil } -func (m *AffiliateParameters) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAffiliates - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AffiliateParameters: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AffiliateParameters: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Maximum_30DAttributableVolumePerReferredUserQuoteQuantums", wireType) - } - m.Maximum_30DAttributableVolumePerReferredUserQuoteQuantums = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAffiliates - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Maximum_30DAttributableVolumePerReferredUserQuoteQuantums |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RefereeMinimumFeeTierIdx", wireType) - } - m.RefereeMinimumFeeTierIdx = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAffiliates - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RefereeMinimumFeeTierIdx |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Maximum_30DAffiliateRevenuePerReferredUserQuoteQuantums", wireType) - } - m.Maximum_30DAffiliateRevenuePerReferredUserQuoteQuantums = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAffiliates - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Maximum_30DAffiliateRevenuePerReferredUserQuoteQuantums |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipAffiliates(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAffiliates - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AffiliateOverrides) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAffiliates - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AffiliateOverrides: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AffiliateOverrides: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Addresses", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAffiliates - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAffiliates - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAffiliates - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Addresses = append(m.Addresses, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAffiliates(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAffiliates - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipAffiliates(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/protocol/x/affiliates/types/constants.go b/protocol/x/affiliates/types/constants.go index ba1d3f7f061..788eb5c9e00 100644 --- a/protocol/x/affiliates/types/constants.go +++ b/protocol/x/affiliates/types/constants.go @@ -23,19 +23,8 @@ var ( ReqStakedWholeCoins: 5_000, // 5000 whole coins TakerFeeSharePpm: 150_000, // 15% }, - { - ReqReferredVolumeQuoteQuantums: 50_000_000_000_000, // 50 million USDC - ReqStakedWholeCoins: 100_000_000, // 100m whole coins - TakerFeeSharePpm: 250_000, // 25% - }, }, } - DefaultAffiliateParameters = AffiliateParameters{ - Maximum_30DAttributableVolumePerReferredUserQuoteQuantums: 100_000_000_000_000, // 100 million USDC - RefereeMinimumFeeTierIdx: 2, - Maximum_30DAffiliateRevenuePerReferredUserQuoteQuantums: 10_000_000_000, // 10k commission - } - AffiliatesRevSharePpmCap = uint32(500_000) // 50% ) diff --git a/protocol/x/affiliates/types/keys.go b/protocol/x/affiliates/types/keys.go index c70a9f34d74..fe3f38692f5 100644 --- a/protocol/x/affiliates/types/keys.go +++ b/protocol/x/affiliates/types/keys.go @@ -18,8 +18,4 @@ const ( AffiliateTiersKey = "AT" AffiliateWhitelistKey = "AW" - - AffiliateParametersKey = "AP" - - AffiliateOverridesKey = "AO" ) diff --git a/protocol/x/affiliates/types/query.pb.go b/protocol/x/affiliates/types/query.pb.go index 58e529a11ac..5ba1fd76dbb 100644 --- a/protocol/x/affiliates/types/query.pb.go +++ b/protocol/x/affiliates/types/query.pb.go @@ -89,11 +89,9 @@ type AffiliateInfoResponse struct { // regular affiliate). FeeSharePpm uint32 `protobuf:"varint,3,opt,name=fee_share_ppm,json=feeSharePpm,proto3" json:"fee_share_ppm,omitempty"` // The affiliate's all-time referred volume in quote quantums. - ReferredVolume github_com_dydxprotocol_v4_chain_protocol_dtypes.SerializableInt `protobuf:"bytes,4,opt,name=referred_volume,json=referredVolume,proto3,customtype=github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt" json:"referred_volume"` // Deprecated: Do not use. + ReferredVolume github_com_dydxprotocol_v4_chain_protocol_dtypes.SerializableInt `protobuf:"bytes,4,opt,name=referred_volume,json=referredVolume,proto3,customtype=github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt" json:"referred_volume"` // The affiliate's currently staked native tokens (in whole coins). StakedAmount github_com_dydxprotocol_v4_chain_protocol_dtypes.SerializableInt `protobuf:"bytes,5,opt,name=staked_amount,json=stakedAmount,proto3,customtype=github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt" json:"staked_amount"` - // The affiliate's 30d referred volume in quote quantums. - ReferredVolume_30DRolling github_com_dydxprotocol_v4_chain_protocol_dtypes.SerializableInt `protobuf:"bytes,6,opt,name=referred_volume_30d_rolling,json=referredVolume30dRolling,proto3,customtype=github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt" json:"referred_volume_30d_rolling"` } func (m *AffiliateInfoResponse) Reset() { *m = AffiliateInfoResponse{} } @@ -411,174 +409,6 @@ func (m *AffiliateWhitelistResponse) GetWhitelist() AffiliateWhitelist { return AffiliateWhitelist{} } -// AffiliateOverridesRequest is the request type for the -// Query/AffiliateOverrides RPC method. -type AffiliateOverridesRequest struct { -} - -func (m *AffiliateOverridesRequest) Reset() { *m = AffiliateOverridesRequest{} } -func (m *AffiliateOverridesRequest) String() string { return proto.CompactTextString(m) } -func (*AffiliateOverridesRequest) ProtoMessage() {} -func (*AffiliateOverridesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2edc1b3ea39b05a9, []int{8} -} -func (m *AffiliateOverridesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AffiliateOverridesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AffiliateOverridesRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AffiliateOverridesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AffiliateOverridesRequest.Merge(m, src) -} -func (m *AffiliateOverridesRequest) XXX_Size() int { - return m.Size() -} -func (m *AffiliateOverridesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AffiliateOverridesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AffiliateOverridesRequest proto.InternalMessageInfo - -// AffiliateOverridesResponse is the response type for the -// Query/AffiliateOverrides RPC method. -type AffiliateOverridesResponse struct { - Overrides AffiliateOverrides `protobuf:"bytes,1,opt,name=overrides,proto3" json:"overrides"` -} - -func (m *AffiliateOverridesResponse) Reset() { *m = AffiliateOverridesResponse{} } -func (m *AffiliateOverridesResponse) String() string { return proto.CompactTextString(m) } -func (*AffiliateOverridesResponse) ProtoMessage() {} -func (*AffiliateOverridesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2edc1b3ea39b05a9, []int{9} -} -func (m *AffiliateOverridesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AffiliateOverridesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AffiliateOverridesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AffiliateOverridesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AffiliateOverridesResponse.Merge(m, src) -} -func (m *AffiliateOverridesResponse) XXX_Size() int { - return m.Size() -} -func (m *AffiliateOverridesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AffiliateOverridesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AffiliateOverridesResponse proto.InternalMessageInfo - -func (m *AffiliateOverridesResponse) GetOverrides() AffiliateOverrides { - if m != nil { - return m.Overrides - } - return AffiliateOverrides{} -} - -// AffiliateParametersRequest is the request type for the -// Query/AffiliateParameters RPC method. -type AffiliateParametersRequest struct { -} - -func (m *AffiliateParametersRequest) Reset() { *m = AffiliateParametersRequest{} } -func (m *AffiliateParametersRequest) String() string { return proto.CompactTextString(m) } -func (*AffiliateParametersRequest) ProtoMessage() {} -func (*AffiliateParametersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2edc1b3ea39b05a9, []int{10} -} -func (m *AffiliateParametersRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AffiliateParametersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AffiliateParametersRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AffiliateParametersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AffiliateParametersRequest.Merge(m, src) -} -func (m *AffiliateParametersRequest) XXX_Size() int { - return m.Size() -} -func (m *AffiliateParametersRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AffiliateParametersRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AffiliateParametersRequest proto.InternalMessageInfo - -// AffiliateParametersResponse is the response type for the -// Query/AffiliateParameters RPC method. -type AffiliateParametersResponse struct { - Parameters AffiliateParameters `protobuf:"bytes,1,opt,name=parameters,proto3" json:"parameters"` -} - -func (m *AffiliateParametersResponse) Reset() { *m = AffiliateParametersResponse{} } -func (m *AffiliateParametersResponse) String() string { return proto.CompactTextString(m) } -func (*AffiliateParametersResponse) ProtoMessage() {} -func (*AffiliateParametersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2edc1b3ea39b05a9, []int{11} -} -func (m *AffiliateParametersResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AffiliateParametersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AffiliateParametersResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AffiliateParametersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AffiliateParametersResponse.Merge(m, src) -} -func (m *AffiliateParametersResponse) XXX_Size() int { - return m.Size() -} -func (m *AffiliateParametersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AffiliateParametersResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AffiliateParametersResponse proto.InternalMessageInfo - -func (m *AffiliateParametersResponse) GetParameters() AffiliateParameters { - if m != nil { - return m.Parameters - } - return AffiliateParameters{} -} - func init() { proto.RegisterType((*AffiliateInfoRequest)(nil), "dydxprotocol.affiliates.AffiliateInfoRequest") proto.RegisterType((*AffiliateInfoResponse)(nil), "dydxprotocol.affiliates.AffiliateInfoResponse") @@ -588,10 +418,6 @@ func init() { proto.RegisterType((*AllAffiliateTiersResponse)(nil), "dydxprotocol.affiliates.AllAffiliateTiersResponse") proto.RegisterType((*AffiliateWhitelistRequest)(nil), "dydxprotocol.affiliates.AffiliateWhitelistRequest") proto.RegisterType((*AffiliateWhitelistResponse)(nil), "dydxprotocol.affiliates.AffiliateWhitelistResponse") - proto.RegisterType((*AffiliateOverridesRequest)(nil), "dydxprotocol.affiliates.AffiliateOverridesRequest") - proto.RegisterType((*AffiliateOverridesResponse)(nil), "dydxprotocol.affiliates.AffiliateOverridesResponse") - proto.RegisterType((*AffiliateParametersRequest)(nil), "dydxprotocol.affiliates.AffiliateParametersRequest") - proto.RegisterType((*AffiliateParametersResponse)(nil), "dydxprotocol.affiliates.AffiliateParametersResponse") } func init() { @@ -599,59 +425,49 @@ func init() { } var fileDescriptor_2edc1b3ea39b05a9 = []byte{ - // 822 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0xcf, 0x6f, 0xd3, 0x48, - 0x14, 0xc7, 0xe3, 0xfe, 0xda, 0x76, 0xda, 0x74, 0xb7, 0xb3, 0x5d, 0xad, 0x9b, 0x56, 0x69, 0xe5, - 0xd5, 0x6a, 0xa3, 0x6d, 0x63, 0xb7, 0x49, 0x77, 0x25, 0x24, 0x0e, 0x24, 0x08, 0x41, 0x7b, 0x69, - 0x71, 0x51, 0x91, 0xe0, 0x60, 0x9c, 0x78, 0x92, 0x8c, 0xb0, 0x3d, 0xae, 0xc7, 0x29, 0x0d, 0x88, - 0x0b, 0x17, 0xae, 0x48, 0x9c, 0xf9, 0x03, 0x90, 0x38, 0x20, 0x81, 0xc4, 0xbf, 0xd0, 0x63, 0x05, - 0x17, 0xc4, 0xa1, 0x42, 0x6d, 0xff, 0x10, 0x14, 0x7b, 0x3c, 0x76, 0x9a, 0x44, 0x71, 0x44, 0x6f, - 0xce, 0x7b, 0xf3, 0xde, 0xf7, 0xe3, 0x97, 0xf9, 0x3e, 0x83, 0xbf, 0x8c, 0x96, 0x71, 0xe4, 0xb8, - 0xc4, 0x23, 0x55, 0x62, 0x2a, 0x7a, 0xad, 0x86, 0x4d, 0xac, 0x7b, 0x88, 0x2a, 0x07, 0x4d, 0xe4, - 0xb6, 0x64, 0x3f, 0x03, 0xff, 0x8c, 0x1f, 0x92, 0xa3, 0x43, 0x99, 0x85, 0x2a, 0xa1, 0x16, 0xa1, - 0x9a, 0x9f, 0x53, 0x82, 0x1f, 0x41, 0x4d, 0x66, 0xbe, 0x4e, 0xea, 0x24, 0x88, 0xb7, 0x9f, 0x58, - 0x34, 0xd7, 0x4f, 0x2e, 0x7a, 0x64, 0x27, 0x97, 0xea, 0x84, 0xd4, 0x4d, 0xa4, 0xe8, 0x0e, 0x56, - 0x74, 0xdb, 0x26, 0x9e, 0xee, 0x61, 0x62, 0xb3, 0xac, 0xb4, 0x0d, 0xe6, 0x4b, 0x61, 0xc5, 0x96, - 0x5d, 0x23, 0x2a, 0x3a, 0x68, 0x22, 0xea, 0xc1, 0x02, 0xf8, 0x45, 0x37, 0x0c, 0x17, 0x51, 0x2a, - 0x0a, 0x2b, 0x42, 0x6e, 0xaa, 0x2c, 0x7e, 0xfe, 0x98, 0x9f, 0x67, 0x60, 0xa5, 0x20, 0xb3, 0xe7, - 0xb9, 0xd8, 0xae, 0xab, 0xe1, 0x41, 0xe9, 0x62, 0x14, 0xfc, 0x71, 0xa9, 0x19, 0x75, 0x88, 0x4d, - 0x11, 0xfc, 0x1b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 0x9e, 0x67, 0x53, 0x0f, 0xae, 0x27, 0xff, 0xe2, 0x1e, 0xc5, - 0x55, 0xfc, 0xaf, 0x6f, 0x65, 0xc2, 0x4f, 0x16, 0x7f, 0x04, 0x00, 0x00, 0xff, 0xff, 0xd4, 0x38, - 0xfa, 0x6c, 0x46, 0x0a, 0x00, 0x00, + // 672 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcb, 0x6e, 0xd3, 0x40, + 0x14, 0x8d, 0x4b, 0x03, 0x74, 0xda, 0x14, 0x3a, 0x2a, 0xc2, 0x35, 0x28, 0xad, 0x8c, 0x10, 0x11, + 0xa5, 0x36, 0x4d, 0x2b, 0x24, 0x24, 0x16, 0x24, 0x08, 0x41, 0xd9, 0x00, 0x2e, 0x2a, 0x12, 0x2c, + 0x8c, 0x13, 0x5f, 0x27, 0x23, 0x6c, 0x8f, 0xeb, 0x99, 0x94, 0x06, 0xc4, 0x86, 0x2f, 0x40, 0x62, + 0xcd, 0x07, 0xb0, 0x43, 0x82, 0x25, 0x1f, 0xd0, 0x65, 0x05, 0x9b, 0x8a, 0x45, 0x85, 0x5a, 0x3e, + 0x04, 0x65, 0x3c, 0x71, 0x52, 0x5a, 0xab, 0x89, 0x60, 0x37, 0xbe, 0x8f, 0x73, 0x8e, 0xef, 0x9c, + 0x3b, 0xe8, 0x92, 0xdb, 0x76, 0x37, 0xa3, 0x98, 0x72, 0x5a, 0xa7, 0xbe, 0xe9, 0x78, 0x1e, 0xf1, + 0x89, 0xc3, 0x81, 0x99, 0xeb, 0x2d, 0x88, 0xdb, 0x86, 0xc8, 0xe0, 0xf3, 0xfd, 0x45, 0x46, 0xaf, + 0x48, 0x9b, 0xa9, 0x53, 0x16, 0x50, 0x66, 0x8b, 0x9c, 0x99, 0x7c, 0x24, 0x3d, 0xda, 0x74, 0x83, + 0x36, 0x68, 0x12, 0xef, 0x9c, 0x64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 0x0f, 0x23, 0x4b, 0x78, 0xd1, 0x3c, 0xf6, 0x89, 0xb0, 0x49, 0xe8, 0x51, + 0xf3, 0x8d, 0xbc, 0xf0, 0xb7, 0xf8, 0xa3, 0x82, 0x50, 0xcf, 0x1d, 0xf8, 0x6a, 0x26, 0xf3, 0x21, + 0x2f, 0x6a, 0xf3, 0x03, 0xd5, 0x4a, 0x89, 0x37, 0x84, 0xc4, 0xeb, 0xd8, 0xc8, 0x94, 0x98, 0xae, + 0x73, 0xad, 0xdd, 0xa7, 0xef, 0xb3, 0x82, 0xa6, 0x0e, 0x99, 0x08, 0x2f, 0x66, 0x0f, 0x28, 0xc3, + 0x8c, 0x5a, 0x79, 0x98, 0x16, 0x29, 0x7a, 0x59, 0x88, 0x36, 0xf0, 0xb5, 0xec, 0xb9, 0xfa, 0xbe, + 0xdd, 0x9b, 0xad, 0x30, 0x25, 0xfe, 0xa2, 0x20, 0x7c, 0xd8, 0x30, 0xb8, 0x3c, 0x84, 0xbb, 0xba, + 0xa2, 0x97, 0x86, 0xea, 0x19, 0x5c, 0x75, 0xaa, 0x38, 0xb5, 0x6f, 0x75, 0x6d, 0x6b, 0xaf, 0xa8, + 0x6c, 0xef, 0x15, 0x95, 0x5f, 0x7b, 0x45, 0xe5, 0xfd, 0x7e, 0x31, 0xb7, 0xbd, 0x5f, 0xcc, 0xed, + 0xec, 0x17, 0x73, 0xcf, 0x6e, 0x0d, 0xfe, 0xb0, 0x6d, 0xf6, 0xb3, 0x88, 0x47, 0xae, 0x76, 0x52, + 0x24, 0x97, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0x9e, 0x0e, 0x60, 0x8f, 0x2d, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -674,10 +490,6 @@ type QueryClient interface { AllAffiliateTiers(ctx context.Context, in *AllAffiliateTiersRequest, opts ...grpc.CallOption) (*AllAffiliateTiersResponse, error) // Query AffiliateWhitelist returns the affiliate whitelist. AffiliateWhitelist(ctx context.Context, in *AffiliateWhitelistRequest, opts ...grpc.CallOption) (*AffiliateWhitelistResponse, error) - // Query AffiliateParameters returns the affiliate parameters. - AffiliateParameters(ctx context.Context, in *AffiliateParametersRequest, opts ...grpc.CallOption) (*AffiliateParametersResponse, error) - // Query AffiliateOverrides returns the affiliate overrides. - AffiliateOverrides(ctx context.Context, in *AffiliateOverridesRequest, opts ...grpc.CallOption) (*AffiliateOverridesResponse, error) } type queryClient struct { @@ -724,24 +536,6 @@ func (c *queryClient) AffiliateWhitelist(ctx context.Context, in *AffiliateWhite return out, nil } -func (c *queryClient) AffiliateParameters(ctx context.Context, in *AffiliateParametersRequest, opts ...grpc.CallOption) (*AffiliateParametersResponse, error) { - out := new(AffiliateParametersResponse) - err := c.cc.Invoke(ctx, "/dydxprotocol.affiliates.Query/AffiliateParameters", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) AffiliateOverrides(ctx context.Context, in *AffiliateOverridesRequest, opts ...grpc.CallOption) (*AffiliateOverridesResponse, error) { - out := new(AffiliateOverridesResponse) - err := c.cc.Invoke(ctx, "/dydxprotocol.affiliates.Query/AffiliateOverrides", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // QueryServer is the server API for Query service. type QueryServer interface { // Query AffiliateInfo returns the affiliate info for a given address. @@ -752,10 +546,6 @@ type QueryServer interface { AllAffiliateTiers(context.Context, *AllAffiliateTiersRequest) (*AllAffiliateTiersResponse, error) // Query AffiliateWhitelist returns the affiliate whitelist. AffiliateWhitelist(context.Context, *AffiliateWhitelistRequest) (*AffiliateWhitelistResponse, error) - // Query AffiliateParameters returns the affiliate parameters. - AffiliateParameters(context.Context, *AffiliateParametersRequest) (*AffiliateParametersResponse, error) - // Query AffiliateOverrides returns the affiliate overrides. - AffiliateOverrides(context.Context, *AffiliateOverridesRequest) (*AffiliateOverridesResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -774,12 +564,6 @@ func (*UnimplementedQueryServer) AllAffiliateTiers(ctx context.Context, req *All func (*UnimplementedQueryServer) AffiliateWhitelist(ctx context.Context, req *AffiliateWhitelistRequest) (*AffiliateWhitelistResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AffiliateWhitelist not implemented") } -func (*UnimplementedQueryServer) AffiliateParameters(ctx context.Context, req *AffiliateParametersRequest) (*AffiliateParametersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AffiliateParameters not implemented") -} -func (*UnimplementedQueryServer) AffiliateOverrides(ctx context.Context, req *AffiliateOverridesRequest) (*AffiliateOverridesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AffiliateOverrides not implemented") -} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -857,42 +641,6 @@ func _Query_AffiliateWhitelist_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } -func _Query_AffiliateParameters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AffiliateParametersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AffiliateParameters(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/dydxprotocol.affiliates.Query/AffiliateParameters", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AffiliateParameters(ctx, req.(*AffiliateParametersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_AffiliateOverrides_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AffiliateOverridesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AffiliateOverrides(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/dydxprotocol.affiliates.Query/AffiliateOverrides", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AffiliateOverrides(ctx, req.(*AffiliateOverridesRequest)) - } - return interceptor(ctx, in, info, handler) -} - var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "dydxprotocol.affiliates.Query", HandlerType: (*QueryServer)(nil), @@ -913,14 +661,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "AffiliateWhitelist", Handler: _Query_AffiliateWhitelist_Handler, }, - { - MethodName: "AffiliateParameters", - Handler: _Query_AffiliateParameters_Handler, - }, - { - MethodName: "AffiliateOverrides", - Handler: _Query_AffiliateOverrides_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "dydxprotocol/affiliates/query.proto", @@ -976,16 +716,6 @@ func (m *AffiliateInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size := m.ReferredVolume_30DRolling.Size() - i -= size - if _, err := m.ReferredVolume_30DRolling.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 { size := m.StakedAmount.Size() i -= size @@ -1201,118 +931,6 @@ func (m *AffiliateWhitelistResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *AffiliateOverridesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AffiliateOverridesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AffiliateOverridesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *AffiliateOverridesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AffiliateOverridesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AffiliateOverridesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Overrides.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *AffiliateParametersRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AffiliateParametersRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AffiliateParametersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *AffiliateParametersResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AffiliateParametersResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AffiliateParametersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Parameters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -1356,8 +974,6 @@ func (m *AffiliateInfoResponse) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) l = m.StakedAmount.Size() n += 1 + l + sovQuery(uint64(l)) - l = m.ReferredVolume_30DRolling.Size() - n += 1 + l + sovQuery(uint64(l)) return n } @@ -1427,48 +1043,8 @@ func (m *AffiliateWhitelistResponse) Size() (n int) { return n } -func (m *AffiliateOverridesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *AffiliateOverridesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Overrides.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *AffiliateParametersRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *AffiliateParametersResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Parameters.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 } func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1708,39 +1284,6 @@ func (m *AffiliateInfoResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ReferredVolume_30DRolling", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ReferredVolume_30DRolling.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -2192,272 +1735,6 @@ func (m *AffiliateWhitelistResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AffiliateOverridesRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AffiliateOverridesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AffiliateOverridesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AffiliateOverridesResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AffiliateOverridesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AffiliateOverridesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Overrides", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Overrides.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AffiliateParametersRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AffiliateParametersRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AffiliateParametersRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AffiliateParametersResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AffiliateParametersResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AffiliateParametersResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Parameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/protocol/x/affiliates/types/query.pb.gw.go b/protocol/x/affiliates/types/query.pb.gw.go index 6754da52155..dfd8a2f41c8 100644 --- a/protocol/x/affiliates/types/query.pb.gw.go +++ b/protocol/x/affiliates/types/query.pb.gw.go @@ -177,42 +177,6 @@ func local_request_Query_AffiliateWhitelist_0(ctx context.Context, marshaler run } -func request_Query_AffiliateParameters_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AffiliateParametersRequest - var metadata runtime.ServerMetadata - - msg, err := client.AffiliateParameters(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_AffiliateParameters_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AffiliateParametersRequest - var metadata runtime.ServerMetadata - - msg, err := server.AffiliateParameters(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_AffiliateOverrides_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AffiliateOverridesRequest - var metadata runtime.ServerMetadata - - msg, err := client.AffiliateOverrides(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_AffiliateOverrides_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AffiliateOverridesRequest - var metadata runtime.ServerMetadata - - msg, err := server.AffiliateOverrides(ctx, &protoReq) - return msg, metadata, err - -} - // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -311,52 +275,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_AffiliateParameters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_AffiliateParameters_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AffiliateParameters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AffiliateOverrides_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_AffiliateOverrides_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AffiliateOverrides_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -478,46 +396,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_AffiliateParameters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_AffiliateParameters_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AffiliateParameters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AffiliateOverrides_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_AffiliateOverrides_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AffiliateOverrides_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -529,10 +407,6 @@ var ( pattern_Query_AllAffiliateTiers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dydxprotocol", "affiliates", "all_affiliate_tiers"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_AffiliateWhitelist_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dydxprotocol", "affiliates", "affiliate_whitelist"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_AffiliateParameters_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dydxprotocol", "affiliates", "affiliate_parameters"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_AffiliateOverrides_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dydxprotocol", "affiliates", "affiliate_overrides"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -543,8 +417,4 @@ var ( forward_Query_AllAffiliateTiers_0 = runtime.ForwardResponseMessage forward_Query_AffiliateWhitelist_0 = runtime.ForwardResponseMessage - - forward_Query_AffiliateParameters_0 = runtime.ForwardResponseMessage - - forward_Query_AffiliateOverrides_0 = runtime.ForwardResponseMessage ) diff --git a/protocol/x/affiliates/types/tx.pb.go b/protocol/x/affiliates/types/tx.pb.go index 09b3e4d40da..c77dc192c24 100644 --- a/protocol/x/affiliates/types/tx.pb.go +++ b/protocol/x/affiliates/types/tx.pb.go @@ -292,190 +292,6 @@ func (m *MsgUpdateAffiliateWhitelistResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateAffiliateWhitelistResponse proto.InternalMessageInfo -// Message to update affiliate program parameters -type MsgUpdateAffiliateParameters struct { - // Authority sending this message. Will be sent by gov - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // Affiliate program parameters - AffiliateParameters AffiliateParameters `protobuf:"bytes,2,opt,name=affiliate_parameters,json=affiliateParameters,proto3" json:"affiliate_parameters"` -} - -func (m *MsgUpdateAffiliateParameters) Reset() { *m = MsgUpdateAffiliateParameters{} } -func (m *MsgUpdateAffiliateParameters) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateAffiliateParameters) ProtoMessage() {} -func (*MsgUpdateAffiliateParameters) Descriptor() ([]byte, []int) { - return fileDescriptor_41c2f092a0ec6d7f, []int{6} -} -func (m *MsgUpdateAffiliateParameters) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateAffiliateParameters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateAffiliateParameters.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgUpdateAffiliateParameters) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateAffiliateParameters.Merge(m, src) -} -func (m *MsgUpdateAffiliateParameters) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateAffiliateParameters) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateAffiliateParameters.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateAffiliateParameters proto.InternalMessageInfo - -func (m *MsgUpdateAffiliateParameters) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgUpdateAffiliateParameters) GetAffiliateParameters() AffiliateParameters { - if m != nil { - return m.AffiliateParameters - } - return AffiliateParameters{} -} - -// Response to MsgUpdateAffiliateParameters -type MsgUpdateAffiliateParametersResponse struct { -} - -func (m *MsgUpdateAffiliateParametersResponse) Reset() { *m = MsgUpdateAffiliateParametersResponse{} } -func (m *MsgUpdateAffiliateParametersResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateAffiliateParametersResponse) ProtoMessage() {} -func (*MsgUpdateAffiliateParametersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_41c2f092a0ec6d7f, []int{7} -} -func (m *MsgUpdateAffiliateParametersResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateAffiliateParametersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateAffiliateParametersResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgUpdateAffiliateParametersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateAffiliateParametersResponse.Merge(m, src) -} -func (m *MsgUpdateAffiliateParametersResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateAffiliateParametersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateAffiliateParametersResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateAffiliateParametersResponse proto.InternalMessageInfo - -// Message to update affiliate overrides -type MsgUpdateAffiliateOverrides struct { - // Authority sending this message. Will be sent by gov - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // Addresses that automatically have the maximum affiliate tier - AffiliateOverrides AffiliateOverrides `protobuf:"bytes,2,opt,name=affiliate_overrides,json=affiliateOverrides,proto3" json:"affiliate_overrides"` -} - -func (m *MsgUpdateAffiliateOverrides) Reset() { *m = MsgUpdateAffiliateOverrides{} } -func (m *MsgUpdateAffiliateOverrides) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateAffiliateOverrides) ProtoMessage() {} -func (*MsgUpdateAffiliateOverrides) Descriptor() ([]byte, []int) { - return fileDescriptor_41c2f092a0ec6d7f, []int{8} -} -func (m *MsgUpdateAffiliateOverrides) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateAffiliateOverrides) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateAffiliateOverrides.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgUpdateAffiliateOverrides) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateAffiliateOverrides.Merge(m, src) -} -func (m *MsgUpdateAffiliateOverrides) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateAffiliateOverrides) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateAffiliateOverrides.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateAffiliateOverrides proto.InternalMessageInfo - -func (m *MsgUpdateAffiliateOverrides) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgUpdateAffiliateOverrides) GetAffiliateOverrides() AffiliateOverrides { - if m != nil { - return m.AffiliateOverrides - } - return AffiliateOverrides{} -} - -// Response to MsgUpdateAffiliateOverrides -type MsgUpdateAffiliateOverridesResponse struct { -} - -func (m *MsgUpdateAffiliateOverridesResponse) Reset() { *m = MsgUpdateAffiliateOverridesResponse{} } -func (m *MsgUpdateAffiliateOverridesResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateAffiliateOverridesResponse) ProtoMessage() {} -func (*MsgUpdateAffiliateOverridesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_41c2f092a0ec6d7f, []int{9} -} -func (m *MsgUpdateAffiliateOverridesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateAffiliateOverridesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateAffiliateOverridesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgUpdateAffiliateOverridesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateAffiliateOverridesResponse.Merge(m, src) -} -func (m *MsgUpdateAffiliateOverridesResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateAffiliateOverridesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateAffiliateOverridesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateAffiliateOverridesResponse proto.InternalMessageInfo - func init() { proto.RegisterType((*MsgRegisterAffiliate)(nil), "dydxprotocol.affiliates.MsgRegisterAffiliate") proto.RegisterType((*MsgRegisterAffiliateResponse)(nil), "dydxprotocol.affiliates.MsgRegisterAffiliateResponse") @@ -483,53 +299,42 @@ func init() { proto.RegisterType((*MsgUpdateAffiliateTiersResponse)(nil), "dydxprotocol.affiliates.MsgUpdateAffiliateTiersResponse") proto.RegisterType((*MsgUpdateAffiliateWhitelist)(nil), "dydxprotocol.affiliates.MsgUpdateAffiliateWhitelist") proto.RegisterType((*MsgUpdateAffiliateWhitelistResponse)(nil), "dydxprotocol.affiliates.MsgUpdateAffiliateWhitelistResponse") - proto.RegisterType((*MsgUpdateAffiliateParameters)(nil), "dydxprotocol.affiliates.MsgUpdateAffiliateParameters") - proto.RegisterType((*MsgUpdateAffiliateParametersResponse)(nil), "dydxprotocol.affiliates.MsgUpdateAffiliateParametersResponse") - proto.RegisterType((*MsgUpdateAffiliateOverrides)(nil), "dydxprotocol.affiliates.MsgUpdateAffiliateOverrides") - proto.RegisterType((*MsgUpdateAffiliateOverridesResponse)(nil), "dydxprotocol.affiliates.MsgUpdateAffiliateOverridesResponse") } func init() { proto.RegisterFile("dydxprotocol/affiliates/tx.proto", fileDescriptor_41c2f092a0ec6d7f) } var fileDescriptor_41c2f092a0ec6d7f = []byte{ - // 590 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xbd, 0x6f, 0xd3, 0x4e, - 0x18, 0xf6, 0xfd, 0x7e, 0x14, 0x94, 0x43, 0x42, 0xc2, 0x58, 0x4a, 0x6a, 0x90, 0x53, 0xc2, 0x57, - 0x05, 0xc4, 0x86, 0xd0, 0x22, 0x54, 0x95, 0xa1, 0x61, 0x8e, 0x8a, 0xc2, 0x97, 0xc4, 0x12, 0x39, - 0xf1, 0xc5, 0x39, 0x29, 0xc9, 0x59, 0x77, 0xd7, 0x90, 0xac, 0x9d, 0x98, 0x10, 0x6c, 0x8c, 0x9d, - 0x98, 0x19, 0x10, 0x0b, 0xff, 0x40, 0x19, 0x90, 0x2a, 0x26, 0x26, 0x84, 0x92, 0x01, 0xfe, 0x0c, - 0x14, 0x7f, 0xdc, 0x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, 0xaa, 0x94, - 0x53, 0xad, 0x25, 0x8d, 0xba, 0xbe, 0x99, 0x09, 0x1e, 0x59, 0x50, 0xf7, 0x01, 0xd4, 0x12, 0x3f, - 0x0b, 0xb7, 0xe6, 0xe9, 0x25, 0x31, 0xf4, 0x7b, 0x59, 0x19, 0xc2, 0xc4, 0x2b, 0x00, 0x0b, 0xa9, - 0xf3, 0xbc, 0x91, 0x41, 0x56, 0xb0, 0xf4, 0xed, 0x65, 0x58, 0xc2, 0xd0, 0x1b, 0x00, 0x57, 0xd3, - 0x07, 0x70, 0x33, 0x83, 0xb6, 0xa4, 0xe9, 0xf7, 0x97, 0xa2, 0xcd, 0x3b, 0x24, 0x39, 0x1c, 0x59, - 0x0e, 0x49, 0xb0, 0x32, 0x1d, 0x52, 0xec, 0xed, 0xad, 0x3e, 0x3d, 0x1c, 0x1b, 0xe0, 0x68, 0x6c, - 0x80, 0x1f, 0x63, 0x03, 0xbc, 0x9e, 0x18, 0xca, 0xd1, 0xc4, 0x50, 0xbe, 0x4d, 0x0c, 0xe5, 0xf9, - 0xb6, 0x8b, 0x79, 0x67, 0xaf, 0x69, 0xb6, 0x48, 0xcf, 0x9a, 0xb9, 0x77, 0x07, 0x1b, 0xe5, 0x56, - 0xc7, 0xc6, 0x7d, 0x4b, 0xac, 0x0c, 0x67, 0xee, 0xfd, 0x91, 0x87, 0x58, 0xf3, 0xa4, 0x5f, 0xbc, - 0xf3, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x92, 0xe3, 0x83, 0x86, 0x1f, 0x08, 0x00, 0x00, + // 473 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xa9, 0x4c, 0xa9, + 0x28, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0xce, 0xcf, 0xd1, 0x4f, 0x4c, 0x4b, 0xcb, 0xcc, 0xc9, 0x4c, + 0x2c, 0x49, 0x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92, 0x99, 0x5a, 0x54, 0x0c, 0x76, 0x49, + 0x69, 0x49, 0x46, 0x7e, 0x51, 0x66, 0x49, 0x25, 0x41, 0xf7, 0x23, 0x94, 0x0a, 0x39, 0x73, 0xb1, + 0x96, 0x80, 0x0c, 0x00, 0xbb, 0x9e, 0xdb, 0x48, 0x5d, 0x0f, 0x47, 0x5c, 0xe9, 0xa1, 0xda, 0xe7, + 0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0x44, 0xaf, 0x15, 0x1f, 0xc8, 0x1b, 0x08, 0x43, 0x95, + 0x14, 0xb9, 0xe4, 0x71, 0xb8, 0x13, 0xee, 0x97, 0x6d, 0x8c, 0x5c, 0xd2, 0x98, 0x6a, 0xc2, 0x33, + 0x32, 0x4b, 0x52, 0x73, 0x32, 0x8b, 0x4b, 0xc8, 0xf6, 0x8f, 0x3f, 0x17, 0x67, 0x39, 0xcc, 0x10, + 0xa8, 0x9f, 0xb4, 0x09, 0xfb, 0x09, 0x6e, 0x2f, 0xd4, 0x5f, 0x08, 0x33, 0x30, 0xfc, 0xa6, 0xca, + 0xa5, 0x8c, 0xc7, 0xdd, 0x30, 0xff, 0x19, 0x4d, 0x63, 0xe6, 0x62, 0xf6, 0x2d, 0x4e, 0x17, 0xaa, + 0xe4, 0x12, 0xc4, 0x4c, 0x6a, 0xba, 0x38, 0x5d, 0x84, 0x2d, 0xfe, 0xa5, 0x4c, 0x49, 0x52, 0x0e, + 0x73, 0x82, 0x50, 0x13, 0x23, 0x97, 0x08, 0xd6, 0xb4, 0x62, 0x80, 0xcf, 0x3c, 0x6c, 0x3a, 0xa4, + 0x2c, 0x48, 0xd5, 0x01, 0x77, 0x44, 0x1f, 0x23, 0x97, 0x04, 0xce, 0x48, 0x36, 0x21, 0xc1, 0x58, + 0xb8, 0x2e, 0x29, 0x1b, 0x72, 0x74, 0xc1, 0x1c, 0xe4, 0x14, 0x76, 0xe2, 0x91, 0x1c, 0xe3, 0x85, + 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, + 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x36, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, + 0xfa, 0x28, 0xe5, 0x4c, 0x99, 0x89, 0x6e, 0x72, 0x46, 0x62, 0x66, 0x9e, 0x3e, 0x5c, 0xa4, 0x02, + 0xa5, 0x9c, 0xab, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0x4b, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, + 0xff, 0x18, 0x7b, 0xfd, 0xff, 0x0f, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -550,10 +355,6 @@ type MsgClient interface { UpdateAffiliateTiers(ctx context.Context, in *MsgUpdateAffiliateTiers, opts ...grpc.CallOption) (*MsgUpdateAffiliateTiersResponse, error) // UpdateAffiliateWhitelist updates affiliate whitelist UpdateAffiliateWhitelist(ctx context.Context, in *MsgUpdateAffiliateWhitelist, opts ...grpc.CallOption) (*MsgUpdateAffiliateWhitelistResponse, error) - // UpdateAffiliateParameters updates affiliate program parameters - UpdateAffiliateParameters(ctx context.Context, in *MsgUpdateAffiliateParameters, opts ...grpc.CallOption) (*MsgUpdateAffiliateParametersResponse, error) - // UpdateAffiliateOverrides updates affiliate overrides - UpdateAffiliateOverrides(ctx context.Context, in *MsgUpdateAffiliateOverrides, opts ...grpc.CallOption) (*MsgUpdateAffiliateOverridesResponse, error) } type msgClient struct { @@ -591,24 +392,6 @@ func (c *msgClient) UpdateAffiliateWhitelist(ctx context.Context, in *MsgUpdateA return out, nil } -func (c *msgClient) UpdateAffiliateParameters(ctx context.Context, in *MsgUpdateAffiliateParameters, opts ...grpc.CallOption) (*MsgUpdateAffiliateParametersResponse, error) { - out := new(MsgUpdateAffiliateParametersResponse) - err := c.cc.Invoke(ctx, "/dydxprotocol.affiliates.Msg/UpdateAffiliateParameters", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UpdateAffiliateOverrides(ctx context.Context, in *MsgUpdateAffiliateOverrides, opts ...grpc.CallOption) (*MsgUpdateAffiliateOverridesResponse, error) { - out := new(MsgUpdateAffiliateOverridesResponse) - err := c.cc.Invoke(ctx, "/dydxprotocol.affiliates.Msg/UpdateAffiliateOverrides", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // MsgServer is the server API for Msg service. type MsgServer interface { // RegisterAffiliate registers a referee-affiliate relationship @@ -617,10 +400,6 @@ type MsgServer interface { UpdateAffiliateTiers(context.Context, *MsgUpdateAffiliateTiers) (*MsgUpdateAffiliateTiersResponse, error) // UpdateAffiliateWhitelist updates affiliate whitelist UpdateAffiliateWhitelist(context.Context, *MsgUpdateAffiliateWhitelist) (*MsgUpdateAffiliateWhitelistResponse, error) - // UpdateAffiliateParameters updates affiliate program parameters - UpdateAffiliateParameters(context.Context, *MsgUpdateAffiliateParameters) (*MsgUpdateAffiliateParametersResponse, error) - // UpdateAffiliateOverrides updates affiliate overrides - UpdateAffiliateOverrides(context.Context, *MsgUpdateAffiliateOverrides) (*MsgUpdateAffiliateOverridesResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -636,12 +415,6 @@ func (*UnimplementedMsgServer) UpdateAffiliateTiers(ctx context.Context, req *Ms func (*UnimplementedMsgServer) UpdateAffiliateWhitelist(ctx context.Context, req *MsgUpdateAffiliateWhitelist) (*MsgUpdateAffiliateWhitelistResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateAffiliateWhitelist not implemented") } -func (*UnimplementedMsgServer) UpdateAffiliateParameters(ctx context.Context, req *MsgUpdateAffiliateParameters) (*MsgUpdateAffiliateParametersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateAffiliateParameters not implemented") -} -func (*UnimplementedMsgServer) UpdateAffiliateOverrides(ctx context.Context, req *MsgUpdateAffiliateOverrides) (*MsgUpdateAffiliateOverridesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateAffiliateOverrides not implemented") -} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -701,42 +474,6 @@ func _Msg_UpdateAffiliateWhitelist_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } -func _Msg_UpdateAffiliateParameters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateAffiliateParameters) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateAffiliateParameters(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/dydxprotocol.affiliates.Msg/UpdateAffiliateParameters", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateAffiliateParameters(ctx, req.(*MsgUpdateAffiliateParameters)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UpdateAffiliateOverrides_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateAffiliateOverrides) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateAffiliateOverrides(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/dydxprotocol.affiliates.Msg/UpdateAffiliateOverrides", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateAffiliateOverrides(ctx, req.(*MsgUpdateAffiliateOverrides)) - } - return interceptor(ctx, in, info, handler) -} - var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "dydxprotocol.affiliates.Msg", HandlerType: (*MsgServer)(nil), @@ -753,14 +490,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateAffiliateWhitelist", Handler: _Msg_UpdateAffiliateWhitelist_Handler, }, - { - MethodName: "UpdateAffiliateParameters", - Handler: _Msg_UpdateAffiliateParameters_Handler, - }, - { - MethodName: "UpdateAffiliateOverrides", - Handler: _Msg_UpdateAffiliateOverrides_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "dydxprotocol/affiliates/tx.proto", @@ -952,601 +681,98 @@ func (m *MsgUpdateAffiliateWhitelistResponse) MarshalToSizedBuffer(dAtA []byte) return len(dAtA) - i, nil } -func (m *MsgUpdateAffiliateParameters) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgUpdateAffiliateParameters) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateAffiliateParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.AffiliateParameters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateAffiliateParametersResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ } - return dAtA[:n], nil -} - -func (m *MsgUpdateAffiliateParametersResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateAffiliateParametersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil + dAtA[offset] = uint8(v) + return base } - -func (m *MsgUpdateAffiliateOverrides) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *MsgRegisterAffiliate) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *MsgUpdateAffiliateOverrides) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateAffiliateOverrides) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - { - size, err := m.AffiliateOverrides.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) + l = len(m.Referee) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } - i-- - dAtA[i] = 0x12 - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0xa + l = len(m.Affiliate) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateAffiliateOverridesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgUpdateAffiliateOverridesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateAffiliateOverridesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MsgRegisterAffiliate) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Referee) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Affiliate) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n + return n } func (m *MsgRegisterAffiliateResponse) Size() (n int) { if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgUpdateAffiliateTiers) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Tiers.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgUpdateAffiliateTiersResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgUpdateAffiliateWhitelist) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Whitelist.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgUpdateAffiliateWhitelistResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgUpdateAffiliateParameters) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.AffiliateParameters.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgUpdateAffiliateParametersResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgUpdateAffiliateOverrides) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.AffiliateOverrides.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgUpdateAffiliateOverridesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgRegisterAffiliate) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgRegisterAffiliate: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterAffiliate: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Referee", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Referee = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Affiliate", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Affiliate = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgRegisterAffiliateResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgRegisterAffiliateResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterAffiliateResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF + return 0 } - return nil + var l int + _ = l + return n } -func (m *MsgUpdateAffiliateTiers) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateAffiliateTiers: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateAffiliateTiers: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tiers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Tiers.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } + +func (m *MsgUpdateAffiliateTiers) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } + l = m.Tiers.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} - if iNdEx > l { - return io.ErrUnexpectedEOF +func (m *MsgUpdateAffiliateTiersResponse) Size() (n int) { + if m == nil { + return 0 } - return nil + var l int + _ = l + return n } -func (m *MsgUpdateAffiliateTiersResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateAffiliateTiersResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateAffiliateTiersResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } + +func (m *MsgUpdateAffiliateWhitelist) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } + l = m.Whitelist.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} - if iNdEx > l { - return io.ErrUnexpectedEOF +func (m *MsgUpdateAffiliateWhitelistResponse) Size() (n int) { + if m == nil { + return 0 } - return nil + var l int + _ = l + return n } -func (m *MsgUpdateAffiliateWhitelist) Unmarshal(dAtA []byte) error { + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgRegisterAffiliate) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1569,15 +795,15 @@ func (m *MsgUpdateAffiliateWhitelist) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateAffiliateWhitelist: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRegisterAffiliate: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateAffiliateWhitelist: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRegisterAffiliate: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Referee", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1605,13 +831,13 @@ func (m *MsgUpdateAffiliateWhitelist) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Authority = string(dAtA[iNdEx:postIndex]) + m.Referee = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Whitelist", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Affiliate", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1621,24 +847,23 @@ func (m *MsgUpdateAffiliateWhitelist) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Whitelist.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Affiliate = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1661,7 +886,7 @@ func (m *MsgUpdateAffiliateWhitelist) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateAffiliateWhitelistResponse) Unmarshal(dAtA []byte) error { +func (m *MsgRegisterAffiliateResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1684,10 +909,10 @@ func (m *MsgUpdateAffiliateWhitelistResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateAffiliateWhitelistResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRegisterAffiliateResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateAffiliateWhitelistResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRegisterAffiliateResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -1711,7 +936,7 @@ func (m *MsgUpdateAffiliateWhitelistResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateAffiliateParameters) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateAffiliateTiers) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1734,10 +959,10 @@ func (m *MsgUpdateAffiliateParameters) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateAffiliateParameters: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateAffiliateTiers: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateAffiliateParameters: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateAffiliateTiers: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1774,7 +999,7 @@ func (m *MsgUpdateAffiliateParameters) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AffiliateParameters", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Tiers", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1801,7 +1026,7 @@ func (m *MsgUpdateAffiliateParameters) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.AffiliateParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Tiers.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1826,7 +1051,7 @@ func (m *MsgUpdateAffiliateParameters) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateAffiliateParametersResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateAffiliateTiersResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1849,10 +1074,10 @@ func (m *MsgUpdateAffiliateParametersResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateAffiliateParametersResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateAffiliateTiersResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateAffiliateParametersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateAffiliateTiersResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -1876,7 +1101,7 @@ func (m *MsgUpdateAffiliateParametersResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateAffiliateOverrides) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateAffiliateWhitelist) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1899,10 +1124,10 @@ func (m *MsgUpdateAffiliateOverrides) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateAffiliateOverrides: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateAffiliateWhitelist: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateAffiliateOverrides: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateAffiliateWhitelist: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1939,7 +1164,7 @@ func (m *MsgUpdateAffiliateOverrides) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AffiliateOverrides", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Whitelist", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1966,7 +1191,7 @@ func (m *MsgUpdateAffiliateOverrides) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.AffiliateOverrides.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Whitelist.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1991,7 +1216,7 @@ func (m *MsgUpdateAffiliateOverrides) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateAffiliateOverridesResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateAffiliateWhitelistResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2014,10 +1239,10 @@ func (m *MsgUpdateAffiliateOverridesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateAffiliateOverridesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateAffiliateWhitelistResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateAffiliateOverridesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateAffiliateWhitelistResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: