Fix: non-functional update_start_trading_time()

This commit is contained in:
Serkan Reis 2022-10-21 22:30:24 +03:00
parent 6008a4b831
commit b65fabca43
4 changed files with 9 additions and 9 deletions

View File

@ -149,7 +149,7 @@ export type DispatchExecuteArgs = {
| { type: Select<'batch_mint'>; recipient: string; batchNumber: number } | { type: Select<'batch_mint'>; recipient: string; batchNumber: number }
| { type: Select<'set_whitelist'>; whitelist: string } | { type: Select<'set_whitelist'>; whitelist: string }
| { type: Select<'update_start_time'>; startTime: string } | { type: Select<'update_start_time'>; startTime: string }
| { type: Select<'update_start_trading_time'>; startTime: string } | { type: Select<'update_start_trading_time'>; startTime?: string }
| { type: Select<'update_per_address_limit'>; limit: number } | { type: Select<'update_per_address_limit'>; limit: number }
| { type: Select<'shuffle'> } | { type: Select<'shuffle'> }
| { type: Select<'withdraw'> } | { type: Select<'withdraw'> }
@ -259,7 +259,7 @@ export const previewExecutePayload = (args: DispatchExecuteArgs) => {
return minterMessages(minterContract)?.updateStartTime(args.startTime) return minterMessages(minterContract)?.updateStartTime(args.startTime)
} }
case 'update_start_trading_time': { case 'update_start_trading_time': {
return minterMessages(minterContract)?.updateStartTradingTime(args.startTime) return minterMessages(minterContract)?.updateStartTradingTime(args.startTime as string)
} }
case 'update_per_address_limit': { case 'update_per_address_limit': {
return minterMessages(minterContract)?.updatePerAddressLimit(args.limit) return minterMessages(minterContract)?.updatePerAddressLimit(args.limit)

View File

@ -33,7 +33,7 @@ export interface MinterInstance {
updateMintPrice: (senderAddress: string, price: string) => Promise<string> updateMintPrice: (senderAddress: string, price: string) => Promise<string>
setWhitelist: (senderAddress: string, whitelist: string) => Promise<string> setWhitelist: (senderAddress: string, whitelist: string) => Promise<string>
updateStartTime: (senderAddress: string, time: Timestamp) => Promise<string> updateStartTime: (senderAddress: string, time: Timestamp) => Promise<string>
updateStartTradingTime: (senderAddress: string, time: Timestamp) => Promise<string> updateStartTradingTime: (senderAddress: string, time?: Timestamp) => Promise<string>
updatePerAddressLimit: (senderAddress: string, perAddressLimit: number) => Promise<string> updatePerAddressLimit: (senderAddress: string, perAddressLimit: number) => Promise<string>
mintTo: (senderAddress: string, recipient: string) => Promise<string> mintTo: (senderAddress: string, recipient: string) => Promise<string>
mintFor: (senderAddress: string, recipient: string, tokenId: number) => Promise<string> mintFor: (senderAddress: string, recipient: string, tokenId: number) => Promise<string>
@ -325,7 +325,7 @@ export const minter = (client: SigningCosmWasmClient, txSigner: string): MinterC
senderAddress, senderAddress,
contractAddress, contractAddress,
{ {
update_start_time: { time }, update_start_time: time,
}, },
'auto', 'auto',
'', '',
@ -334,12 +334,12 @@ export const minter = (client: SigningCosmWasmClient, txSigner: string): MinterC
return res.transactionHash return res.transactionHash
} }
const updateStartTradingTime = async (senderAddress: string, time: Timestamp): Promise<string> => { const updateStartTradingTime = async (senderAddress: string, time?: Timestamp): Promise<string> => {
const res = await client.execute( const res = await client.execute(
senderAddress, senderAddress,
contractAddress, contractAddress,
{ {
update_start_trading_time: { time }, update_start_trading_time: time || null,
}, },
'auto', 'auto',
'', '',

View File

@ -101,7 +101,7 @@ export type DispatchExecuteArgs = {
| { type: Select<'update_mint_price'>; price: string } | { type: Select<'update_mint_price'>; price: string }
| { type: Select<'set_whitelist'>; whitelist: string } | { type: Select<'set_whitelist'>; whitelist: string }
| { type: Select<'update_start_time'>; startTime: string } | { type: Select<'update_start_time'>; startTime: string }
| { type: Select<'update_start_trading_time'>; startTime: string } | { type: Select<'update_start_trading_time'>; startTime?: string }
| { type: Select<'update_per_address_limit'>; limit: number } | { type: Select<'update_per_address_limit'>; limit: number }
| { type: Select<'mint_to'>; recipient: string } | { type: Select<'mint_to'>; recipient: string }
| { type: Select<'mint_for'>; recipient: string; tokenId: number } | { type: Select<'mint_for'>; recipient: string; tokenId: number }
@ -179,7 +179,7 @@ export const previewExecutePayload = (args: DispatchExecuteArgs) => {
return messages(contract)?.updateStartTime(args.startTime) return messages(contract)?.updateStartTime(args.startTime)
} }
case 'update_start_trading_time': { case 'update_start_trading_time': {
return messages(contract)?.updateStartTradingTime(args.startTime) return messages(contract)?.updateStartTradingTime(args.startTime as string)
} }
case 'update_per_address_limit': { case 'update_per_address_limit': {
return messages(contract)?.updatePerAddressLimit(args.limit) return messages(contract)?.updatePerAddressLimit(args.limit)

View File

@ -80,7 +80,7 @@ const MinterExecutePage: NextPage = () => {
}) })
const showWhitelistField = type === 'set_whitelist' const showWhitelistField = type === 'set_whitelist'
const showDateField = type === 'update_start_time' const showDateField = isEitherType(type, ['update_start_time', 'update_start_trading_time'])
const showLimitField = type === 'update_per_address_limit' const showLimitField = type === 'update_per_address_limit'
const showTokenIdField = type === 'mint_for' const showTokenIdField = type === 'mint_for'
const showRecipientField = isEitherType(type, ['mint_to', 'mint_for']) const showRecipientField = isEitherType(type, ['mint_to', 'mint_for'])