difftreelog
Merge branch 'develop' into feature/transferfromtests
in: master
4 files changed
pallets/nft/src/lib.rsdiffbeforeafterboth185185186 // Timeouts for item types in passed blocks186 // Timeouts for item types in passed blocks187 pub sponsor_transfer_timeout: u32,187 pub sponsor_transfer_timeout: u32,188 pub owner_can_transfer: bool,189 pub owner_can_destroy: bool,188}190}189191190impl Default for CollectionLimits {192impl Default for CollectionLimits {193 account_token_ownership_limit: 10_000_000, 195 account_token_ownership_limit: 10_000_000, 194 token_limit: u32::max_value(),196 token_limit: u32::max_value(),195 sponsored_data_size: u32::max_value(), 197 sponsored_data_size: u32::max_value(), 196 sponsor_transfer_timeout: 14400 }198 sponsor_transfer_timeout: 14400,199 owner_can_transfer: true,200 owner_can_destroy: true201 }197 }202 }198}203}runtime_types.jsondiffbeforeafterboth95 "AccountTokenOwnershipLimit": "u32",95 "AccountTokenOwnershipLimit": "u32",96 "SponsoredMintSize": "u32",96 "SponsoredMintSize": "u32",97 "TokenLimit": "u32",97 "TokenLimit": "u32",98 "SponsorTimeout": "u32"98 "SponsorTimeout": "u32",99 "OwnerCanTransfer": "bool",100 "OwnerCanDestroy": "bool"99 }101 }100}102}tests/src/removeFromContractWhiteList.test.tsdiffbeforeafterbothno changes
tests/src/util/helpers.tsdiffbeforeafterboth410 });410 });411}411}412413export async function toggleContractWhitelistExpectSuccess(sender: IKeyringPair, contractAddress: AccountId | string, enabled: boolean) {414 await usingApi(async (api) => {415 const tx = api.tx.nft.toggleContractWhiteList(contractAddress, true);416 const events = await submitTransactionAsync(sender, tx);417 const result = getGenericResult(events);418419 expect(result.success).to.be.true;420 });421}422423export async function isWhitelistedInContract(contractAddress: AccountId | string, user: string) {424 let whitelisted: boolean = false;425 await usingApi(async (api) => {426 whitelisted = (await api.query.nft.contractWhiteList(contractAddress, user)).toJSON() as boolean;427 });428 return whitelisted;429}430431export async function addToContractWhiteListExpectSuccess(sender: IKeyringPair, contractAddress: AccountId | string, user: string) {432 await usingApi(async (api) => {433 const tx = api.tx.nft.addToContractWhiteList(contractAddress, user);434 const events = await submitTransactionAsync(sender, tx);435 const result = getGenericResult(events);436437 expect(result.success).to.be.true;438 });439}440441export async function removeFromContractWhiteListExpectSuccess(sender: IKeyringPair, contractAddress: AccountId | string, user: string) {442 await usingApi(async (api) => {443 const tx = api.tx.nft.removeFromContractWhiteList(contractAddress, user);444 const events = await submitTransactionAsync(sender, tx);445 const result = getGenericResult(events);446447 expect(result.success).to.be.true;448 });449}450451export async function removeFromContractWhiteListExpectFailure(sender: IKeyringPair, contractAddress: AccountId | string, user: string) {452 await usingApi(async (api) => {453 const tx = api.tx.nft.removeFromContractWhiteList(contractAddress, user);454 const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;455 const result = getGenericResult(events);456457 expect(result.success).to.be.false;458 });459}412460413export async function setVariableMetaDataExpectSuccess(sender: IKeyringPair, collectionId: number, itemId: number, data: number[]) {461export async function setVariableMetaDataExpectSuccess(sender: IKeyringPair, collectionId: number, itemId: number, data: number[]) {414 await usingApi(async (api) => {462 await usingApi(async (api) => {