Skip to content

Update client and message composer to underscore funds to avoid conflicts #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions __fixtures__/issues/98/out/98.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export interface 98Interface extends 98ReadOnlyInterface {
}: {
id: number;
instantiateMsg: Binary;
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
registerPlugin: ({
checksum,
codeId,
Expand All @@ -90,12 +90,12 @@ export interface 98Interface extends 98ReadOnlyInterface {
ipfsHash: string;
name: string;
version: string;
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
unregisterPlugin: ({
id
}: {
id: number;
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
updatePlugin: ({
checksum,
codeId,
Expand All @@ -112,17 +112,17 @@ export interface 98Interface extends 98ReadOnlyInterface {
ipfsHash?: string;
name?: string;
version?: string;
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
updateRegistryFee: ({
newFee
}: {
newFee: Coin;
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
updateDaoAddr: ({
newAddr
}: {
newAddr: string;
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
}
export class 98Client extends 98QueryClient implements 98Interface {
client: SigningCosmWasmClient;
Expand All @@ -148,13 +148,13 @@ export class 98Client extends 98QueryClient implements 98Interface {
}: {
id: number;
instantiateMsg: Binary;
}, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
proxy_install_plugin: {
id,
instantiate_msg: instantiateMsg
}
}, fee, memo, funds);
}, fee, memo, _funds);
};
registerPlugin = async ({
checksum,
Expand All @@ -170,7 +170,7 @@ export class 98Client extends 98QueryClient implements 98Interface {
ipfsHash: string;
name: string;
version: string;
}, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
register_plugin: {
checksum,
Expand All @@ -180,18 +180,18 @@ export class 98Client extends 98QueryClient implements 98Interface {
name,
version
}
}, fee, memo, funds);
}, fee, memo, _funds);
};
unregisterPlugin = async ({
id
}: {
id: number;
}, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
unregister_plugin: {
id
}
}, fee, memo, funds);
}, fee, memo, _funds);
};
updatePlugin = async ({
checksum,
Expand All @@ -209,7 +209,7 @@ export class 98Client extends 98QueryClient implements 98Interface {
ipfsHash?: string;
name?: string;
version?: string;
}, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
update_plugin: {
checksum,
Expand All @@ -220,28 +220,28 @@ export class 98Client extends 98QueryClient implements 98Interface {
name,
version
}
}, fee, memo, funds);
}, fee, memo, _funds);
};
updateRegistryFee = async ({
newFee
}: {
newFee: Coin;
}, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
update_registry_fee: {
new_fee: newFee
}
}, fee, memo, funds);
}, fee, memo, _funds);
};
updateDaoAddr = async ({
newAddr
}: {
newAddr: string;
}, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
update_dao_addr: {
new_addr: newAddr
}
}, fee, memo, funds);
}, fee, memo, _funds);
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface CwAdminFactoryInterface {
codeId: number;
instantiateMsg: Binary;
label: string;
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
}
export class CwAdminFactoryClient implements CwAdminFactoryInterface {
client: SigningCosmWasmClient;
Expand All @@ -53,13 +53,13 @@ export class CwAdminFactoryClient implements CwAdminFactoryInterface {
codeId: number;
instantiateMsg: Binary;
label: string;
}, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
instantiate_contract_with_self_admin: {
code_id: codeId,
instantiate_msg: instantiateMsg,
label
}
}, fee, memo, funds);
}, fee, memo, _funds);
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface CwAdminFactoryMessage {
codeId: number;
instantiateMsg: Binary;
label: string;
}, funds?: Coin[]) => MsgExecuteContractEncodeObject;
}, _funds?: Coin[]) => MsgExecuteContractEncodeObject;
}
export class CwAdminFactoryMessageComposer implements CwAdminFactoryMessage {
sender: string;
Expand All @@ -40,7 +40,7 @@ export class CwAdminFactoryMessageComposer implements CwAdminFactoryMessage {
codeId: number;
instantiateMsg: Binary;
label: string;
}, funds?: Coin[]): MsgExecuteContractEncodeObject => {
}, _funds?: Coin[]): MsgExecuteContractEncodeObject => {
return {
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
value: MsgExecuteContract.fromPartial({
Expand All @@ -53,7 +53,7 @@ export class CwAdminFactoryMessageComposer implements CwAdminFactoryMessage {
label
}
})),
funds
funds: _funds
})
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export interface CwCodeIdRegistryInterface {
amount: Uint128;
msg: Binary;
sender: string;
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
register: ({
chainId,
checksum,
Expand All @@ -122,7 +122,7 @@ export interface CwCodeIdRegistryInterface {
codeId: number;
name: string;
version: string;
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
setOwner: ({
chainId,
name,
Expand All @@ -131,21 +131,21 @@ export interface CwCodeIdRegistryInterface {
chainId: string;
name: string;
owner?: string;
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
unregister: ({
chainId,
codeId
}: {
chainId: string;
codeId: number;
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
updateConfig: ({
admin,
paymentInfo
}: {
admin?: string;
paymentInfo?: PaymentInfo;
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
}
export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface {
client: SigningCosmWasmClient;
Expand All @@ -171,14 +171,14 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface {
amount: Uint128;
msg: Binary;
sender: string;
}, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
receive: {
amount,
msg,
sender
}
}, fee, memo, funds);
}, fee, memo, _funds);
};
register = async ({
chainId,
Expand All @@ -192,7 +192,7 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface {
codeId: number;
name: string;
version: string;
}, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
register: {
chain_id: chainId,
Expand All @@ -201,7 +201,7 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface {
name,
version
}
}, fee, memo, funds);
}, fee, memo, _funds);
};
setOwner = async ({
chainId,
Expand All @@ -211,41 +211,41 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface {
chainId: string;
name: string;
owner?: string;
}, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
set_owner: {
chain_id: chainId,
name,
owner
}
}, fee, memo, funds);
}, fee, memo, _funds);
};
unregister = async ({
chainId,
codeId
}: {
chainId: string;
codeId: number;
}, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
unregister: {
chain_id: chainId,
code_id: codeId
}
}, fee, memo, funds);
}, fee, memo, _funds);
};
updateConfig = async ({
admin,
paymentInfo
}: {
admin?: string;
paymentInfo?: PaymentInfo;
}, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
update_config: {
admin,
payment_info: paymentInfo
}
}, fee, memo, funds);
}, fee, memo, _funds);
};
}
Loading