-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[OTE-790]Implement affiliates whitelist logic #2258
Changes from all commits
4c61284
e0a6f72
77487f6
dd39cff
005563c
8002cdc
d5f3912
03d3d29
c63d3d5
bf5d082
5457b7d
2fa8b55
1491ef0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,4 +1,4 @@ | ||||||||||||||
import { AffiliateTiers, AffiliateTiersSDKType } 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 */ | ||||||||||||||
|
@@ -49,6 +49,30 @@ export interface MsgUpdateAffiliateTiersResponse {} | |||||||||||||
/** Response to MsgUpdateAffiliateTiers */ | ||||||||||||||
|
||||||||||||||
export interface MsgUpdateAffiliateTiersResponseSDKType {} | ||||||||||||||
/** Message to update affiliate whitelist */ | ||||||||||||||
|
||||||||||||||
export interface MsgUpdateAffiliateWhitelist { | ||||||||||||||
/** Authority sending this message. Will be sent by gov */ | ||||||||||||||
authority: string; | ||||||||||||||
/** Updated affiliate whitelist information */ | ||||||||||||||
|
||||||||||||||
whitelist?: AffiliateWhitelist; | ||||||||||||||
} | ||||||||||||||
/** Message to update affiliate whitelist */ | ||||||||||||||
|
||||||||||||||
export interface MsgUpdateAffiliateWhitelistSDKType { | ||||||||||||||
/** Authority sending this message. Will be sent by gov */ | ||||||||||||||
authority: string; | ||||||||||||||
/** Updated affiliate whitelist information */ | ||||||||||||||
|
||||||||||||||
whitelist?: AffiliateWhitelistSDKType; | ||||||||||||||
} | ||||||||||||||
/** Response to MsgUpdateAffiliateWhitelist */ | ||||||||||||||
|
||||||||||||||
export interface MsgUpdateAffiliateWhitelistResponse {} | ||||||||||||||
/** Response to MsgUpdateAffiliateWhitelist */ | ||||||||||||||
|
||||||||||||||
export interface MsgUpdateAffiliateWhitelistResponseSDKType {} | ||||||||||||||
|
||||||||||||||
Comment on lines
+73
to
+75
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider using a type alias instead of an empty interface. Similar to the -export interface MsgUpdateAffiliateWhitelistResponseSDKType {}
+export type MsgUpdateAffiliateWhitelistResponseSDKType = Record<string, never>; Committable suggestion
Suggested change
ToolsBiome
|
||||||||||||||
function createBaseMsgRegisterAffiliate(): MsgRegisterAffiliate { | ||||||||||||||
return { | ||||||||||||||
|
@@ -226,4 +250,93 @@ export const MsgUpdateAffiliateTiersResponse = { | |||||||||||||
return message; | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
}; | ||||||||||||||
|
||||||||||||||
function createBaseMsgUpdateAffiliateWhitelist(): MsgUpdateAffiliateWhitelist { | ||||||||||||||
return { | ||||||||||||||
authority: "", | ||||||||||||||
whitelist: undefined | ||||||||||||||
}; | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
export const MsgUpdateAffiliateWhitelist = { | ||||||||||||||
encode(message: MsgUpdateAffiliateWhitelist, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { | ||||||||||||||
if (message.authority !== "") { | ||||||||||||||
writer.uint32(10).string(message.authority); | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
if (message.whitelist !== undefined) { | ||||||||||||||
AffiliateWhitelist.encode(message.whitelist, writer.uint32(18).fork()).ldelim(); | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
return writer; | ||||||||||||||
}, | ||||||||||||||
|
||||||||||||||
decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateAffiliateWhitelist { | ||||||||||||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); | ||||||||||||||
let end = length === undefined ? reader.len : reader.pos + length; | ||||||||||||||
const message = createBaseMsgUpdateAffiliateWhitelist(); | ||||||||||||||
|
||||||||||||||
while (reader.pos < end) { | ||||||||||||||
const tag = reader.uint32(); | ||||||||||||||
|
||||||||||||||
switch (tag >>> 3) { | ||||||||||||||
case 1: | ||||||||||||||
message.authority = reader.string(); | ||||||||||||||
break; | ||||||||||||||
|
||||||||||||||
case 2: | ||||||||||||||
message.whitelist = AffiliateWhitelist.decode(reader, reader.uint32()); | ||||||||||||||
break; | ||||||||||||||
|
||||||||||||||
default: | ||||||||||||||
reader.skipType(tag & 7); | ||||||||||||||
break; | ||||||||||||||
} | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
return message; | ||||||||||||||
}, | ||||||||||||||
|
||||||||||||||
fromPartial(object: DeepPartial<MsgUpdateAffiliateWhitelist>): MsgUpdateAffiliateWhitelist { | ||||||||||||||
const message = createBaseMsgUpdateAffiliateWhitelist(); | ||||||||||||||
message.authority = object.authority ?? ""; | ||||||||||||||
message.whitelist = object.whitelist !== undefined && object.whitelist !== null ? AffiliateWhitelist.fromPartial(object.whitelist) : undefined; | ||||||||||||||
return message; | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
}; | ||||||||||||||
|
||||||||||||||
function createBaseMsgUpdateAffiliateWhitelistResponse(): MsgUpdateAffiliateWhitelistResponse { | ||||||||||||||
return {}; | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
export const MsgUpdateAffiliateWhitelistResponse = { | ||||||||||||||
encode(_: MsgUpdateAffiliateWhitelistResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { | ||||||||||||||
return writer; | ||||||||||||||
}, | ||||||||||||||
|
||||||||||||||
decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateAffiliateWhitelistResponse { | ||||||||||||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); | ||||||||||||||
let end = length === undefined ? reader.len : reader.pos + length; | ||||||||||||||
const message = createBaseMsgUpdateAffiliateWhitelistResponse(); | ||||||||||||||
|
||||||||||||||
while (reader.pos < end) { | ||||||||||||||
const tag = reader.uint32(); | ||||||||||||||
|
||||||||||||||
switch (tag >>> 3) { | ||||||||||||||
default: | ||||||||||||||
reader.skipType(tag & 7); | ||||||||||||||
break; | ||||||||||||||
} | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
return message; | ||||||||||||||
}, | ||||||||||||||
|
||||||||||||||
fromPartial(_: DeepPartial<MsgUpdateAffiliateWhitelistResponse>): MsgUpdateAffiliateWhitelistResponse { | ||||||||||||||
const message = createBaseMsgUpdateAffiliateWhitelistResponse(); | ||||||||||||||
return message; | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using a type alias instead of an empty interface.
The
MsgUpdateAffiliateWhitelistResponse
interface is empty, which is equivalent to{}
. To improve code clarity and maintainability, consider using a type alias instead.Committable suggestion
Tools
Biome