Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

add edge cases for undefined on createCreateProtoType #400

Merged
merged 4 commits into from
Jun 27, 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
42 changes: 21 additions & 21 deletions __fixtures__/output1/Minter.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,31 +68,31 @@ export class MinterQueryClient implements MinterReadOnlyInterface {
export interface MinterInterface extends MinterReadOnlyInterface {
contractAddress: string;
sender: string;
mint: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
mint: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
setWhitelist: ({
whitelist
}: {
whitelist: string;
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
updateStartTime: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
updateStartTime: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
updatePerAddressLimit: ({
perAddressLimit
}: {
perAddressLimit: number;
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
mintTo: ({
recipient
}: {
recipient: string;
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
mintFor: ({
recipient,
tokenId
}: {
recipient: string;
tokenId: number;
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
withdraw: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
withdraw: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
}
export class MinterClient extends MinterQueryClient implements MinterInterface {
client: SigningCosmWasmClient;
Expand All @@ -113,66 +113,66 @@ export class MinterClient extends MinterQueryClient implements MinterInterface {
this.withdraw = this.withdraw.bind(this);
}

mint = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
mint = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
mint: {}
}, fee, memo, funds);
}, fee, memo, _funds);
};
setWhitelist = async ({
whitelist
}: {
whitelist: 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_whitelist: {
whitelist
}
}, fee, memo, funds);
}, fee, memo, _funds);
};
updateStartTime = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
updateStartTime = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
update_start_time: {}
}, fee, memo, funds);
}, fee, memo, _funds);
};
updatePerAddressLimit = async ({
perAddressLimit
}: {
perAddressLimit: 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, {
update_per_address_limit: {
per_address_limit: perAddressLimit
}
}, fee, memo, funds);
}, fee, memo, _funds);
};
mintTo = async ({
recipient
}: {
recipient: 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, {
mint_to: {
recipient
}
}, fee, memo, funds);
}, fee, memo, _funds);
};
mintFor = async ({
recipient,
tokenId
}: {
recipient: string;
tokenId: 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, {
mint_for: {
recipient,
token_id: tokenId
}
}, fee, memo, funds);
}, fee, memo, _funds);
};
withdraw = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
withdraw = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
withdraw: {}
}, fee, memo, funds);
}, fee, memo, _funds);
};
}
48 changes: 24 additions & 24 deletions __fixtures__/output1/Sg721.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export interface Sg721Interface extends Sg721ReadOnlyInterface {
}: {
recipient: string;
tokenId: string;
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
sendNft: ({
contract,
msg,
Expand All @@ -257,7 +257,7 @@ export interface Sg721Interface extends Sg721ReadOnlyInterface {
contract: string;
msg: Binary;
tokenId: string;
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
approve: ({
expires,
spender,
Expand All @@ -266,26 +266,26 @@ export interface Sg721Interface extends Sg721ReadOnlyInterface {
expires?: Expiration;
spender: string;
tokenId: string;
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
revoke: ({
spender,
tokenId
}: {
spender: string;
tokenId: string;
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
approveAll: ({
expires,
operator
}: {
expires?: Expiration;
operator: string;
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
revokeAll: ({
operator
}: {
operator: string;
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
mint: ({
extension,
owner,
Expand All @@ -296,12 +296,12 @@ export interface Sg721Interface extends Sg721ReadOnlyInterface {
owner: string;
tokenId: string;
tokenUri?: string;
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
burn: ({
tokenId
}: {
tokenId: string;
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
}
export class Sg721Client extends Sg721QueryClient implements Sg721Interface {
client: SigningCosmWasmClient;
Expand Down Expand Up @@ -329,13 +329,13 @@ export class Sg721Client extends Sg721QueryClient implements Sg721Interface {
}: {
recipient: string;
tokenId: 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, {
transfer_nft: {
recipient,
token_id: tokenId
}
}, fee, memo, funds);
}, fee, memo, _funds);
};
sendNft = async ({
contract,
Expand All @@ -345,14 +345,14 @@ export class Sg721Client extends Sg721QueryClient implements Sg721Interface {
contract: string;
msg: Binary;
tokenId: 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, {
send_nft: {
contract,
msg,
token_id: tokenId
}
}, fee, memo, funds);
}, fee, memo, _funds);
};
approve = async ({
expires,
Expand All @@ -362,53 +362,53 @@ export class Sg721Client extends Sg721QueryClient implements Sg721Interface {
expires?: Expiration;
spender: string;
tokenId: 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, {
approve: {
expires,
spender,
token_id: tokenId
}
}, fee, memo, funds);
}, fee, memo, _funds);
};
revoke = async ({
spender,
tokenId
}: {
spender: string;
tokenId: 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, {
revoke: {
spender,
token_id: tokenId
}
}, fee, memo, funds);
}, fee, memo, _funds);
};
approveAll = async ({
expires,
operator
}: {
expires?: Expiration;
operator: 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, {
approve_all: {
expires,
operator
}
}, fee, memo, funds);
}, fee, memo, _funds);
};
revokeAll = async ({
operator
}: {
operator: 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, {
revoke_all: {
operator
}
}, fee, memo, funds);
}, fee, memo, _funds);
};
mint = async ({
extension,
Expand All @@ -420,25 +420,25 @@ export class Sg721Client extends Sg721QueryClient implements Sg721Interface {
owner: string;
tokenId: string;
tokenUri?: 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, {
mint: {
extension,
owner,
token_id: tokenId,
token_uri: tokenUri
}
}, fee, memo, funds);
}, fee, memo, _funds);
};
burn = async ({
tokenId
}: {
tokenId: 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, {
burn: {
token_id: tokenId
}
}, fee, memo, funds);
}, fee, memo, _funds);
};
}
8 changes: 4 additions & 4 deletions __fixtures__/output1/akash/audit/v1beta2/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export interface QueryAuditorAttributesRequestSDKType {
function createBaseQueryProvidersResponse(): QueryProvidersResponse {
return {
providers: [],
pagination: undefined
pagination: PageResponse.fromPartial({})
};
}
export const QueryProvidersResponse = {
Expand Down Expand Up @@ -205,7 +205,7 @@ export const QueryProviderRequest = {
};
function createBaseQueryAllProvidersAttributesRequest(): QueryAllProvidersAttributesRequest {
return {
pagination: undefined
pagination: PageRequest.fromPartial({})
};
}
export const QueryAllProvidersAttributesRequest = {
Expand Down Expand Up @@ -261,7 +261,7 @@ export const QueryAllProvidersAttributesRequest = {
function createBaseQueryProviderAttributesRequest(): QueryProviderAttributesRequest {
return {
owner: "",
pagination: undefined
pagination: PageRequest.fromPartial({})
};
}
export const QueryProviderAttributesRequest = {
Expand Down Expand Up @@ -395,7 +395,7 @@ export const QueryProviderAuditorRequest = {
function createBaseQueryAuditorAttributesRequest(): QueryAuditorAttributesRequest {
return {
auditor: "",
pagination: undefined
pagination: PageRequest.fromPartial({})
};
}
export const QueryAuditorAttributesRequest = {
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/output1/akash/base/v1beta1/attribute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export const SignedBy = {
};
function createBasePlacementRequirements(): PlacementRequirements {
return {
signedBy: undefined,
signedBy: SignedBy.fromPartial({}),
attributes: []
};
}
Expand Down
6 changes: 3 additions & 3 deletions __fixtures__/output1/akash/base/v1beta1/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export interface ResourceUnitsSDKType {
}
function createBaseCPU(): CPU {
return {
units: undefined,
units: ResourceValue.fromPartial({}),
attributes: []
};
}
Expand Down Expand Up @@ -131,7 +131,7 @@ export const CPU = {
};
function createBaseMemory(): Memory {
return {
quantity: undefined,
quantity: ResourceValue.fromPartial({}),
attributes: []
};
}
Expand Down Expand Up @@ -206,7 +206,7 @@ export const Memory = {
};
function createBaseStorage(): Storage {
return {
quantity: undefined,
quantity: ResourceValue.fromPartial({}),
attributes: []
};
}
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/output1/akash/base/v1beta2/attribute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export const SignedBy = {
};
function createBasePlacementRequirements(): PlacementRequirements {
return {
signedBy: undefined,
signedBy: SignedBy.fromPartial({}),
attributes: []
};
}
Expand Down
Loading