difftreelog
Merge pull request #294 from UniqueNetwork/feature/create-collection-ex
in: master
Remove double option limit
6 files changed
primitives/data-structs/src/lib.rsdiffbeforeafterboth27use derivative::Derivative;27use derivative::Derivative;28use scale_info::TypeInfo;28use scale_info::TypeInfo;2930mod migration;293130pub const MAX_DECIMAL_POINTS: DecimalPoints = 30;32pub const MAX_DECIMAL_POINTS: DecimalPoints = 30;31pub const MAX_REFUNGIBLE_PIECES: u128 = 1_000_000_000_000_000_000_000;33pub const MAX_REFUNGIBLE_PIECES: u128 = 1_000_000_000_000_000_000_000;319 /// None - setVariableMetadata is not sponsored321 /// None - setVariableMetadata is not sponsored320 /// Some(v) - setVariableMetadata is sponsored322 /// Some(v) - setVariableMetadata is sponsored321 /// if there is v block between txs323 /// if there is v block between txs322 pub sponsored_data_rate_limit: Option<(Option<u32>,)>,324 pub sponsored_data_rate_limit: Option<SponsoringRateLimit>,323 pub token_limit: Option<u32>,325 pub token_limit: Option<u32>,324326325 // Timeouts for item types in passed blocks327 // Timeouts for item types in passed blocks366 self.transfers_enabled.unwrap_or(true)368 self.transfers_enabled.unwrap_or(true)367 }369 }368 pub fn sponsored_data_rate_limit(&self) -> Option<u32> {370 pub fn sponsored_data_rate_limit(&self) -> Option<u32> {369 self.sponsored_data_rate_limit371 match self372 .sponsored_data_rate_limit370 .unwrap_or((None,))373 .unwrap_or(SponsoringRateLimit::SponsoringDisabled)371 .0374 {375 SponsoringRateLimit::SponsoringDisabled => None,372 .map(|v| v.min(MAX_SPONSOR_TIMEOUT))376 SponsoringRateLimit::Blocks(v) => Some(v.min(MAX_SPONSOR_TIMEOUT)),377 }373 }378 }374}379}380381#[derive(Encode, Decode, Debug, Clone, Copy, PartialEq, TypeInfo, MaxEncodedLen)]382#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]383pub enum SponsoringRateLimit {384 SponsoringDisabled,385 Blocks(u32),386}375387376/// BoundedVec doesn't supports serde388/// BoundedVec doesn't supports serde377#[cfg(feature = "serde1")]389#[cfg(feature = "serde1")]primitives/data-structs/src/migration.rsdiffbeforeafterbothno changes
tests/src/interfaces/augment-types.tsdiffbeforeafterboth1// Auto-generated via `yarn polkadot-types-from-defs`, do not edit1// Auto-generated via `yarn polkadot-types-from-defs`, do not edit2/* eslint-disable */2/* eslint-disable */334import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportPalletId, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonAccountBasicCrossAccountIdRepr, PalletCommonError, PalletCommonEvent, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletXcmCall, PalletXcmError, PalletXcmEvent, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV1AbridgedHostConfiguration, PolkadotPrimitivesV1AbridgedHrmpChannel, PolkadotPrimitivesV1PersistedValidationData, PolkadotPrimitivesV1UpgradeRestriction, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpTrieStorageProof, SpVersionRuntimeVersion, UniqueRuntimeRuntime, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateNftData, UpDataStructsCreateReFungibleData, UpDataStructsMetaUpdatePermission, UpDataStructsSchemaVersion, UpDataStructsSponsorshipState, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './unique';4import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportPalletId, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonAccountBasicCrossAccountIdRepr, PalletCommonError, PalletCommonEvent, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletXcmCall, PalletXcmError, PalletXcmEvent, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV1AbridgedHostConfiguration, PolkadotPrimitivesV1AbridgedHrmpChannel, PolkadotPrimitivesV1PersistedValidationData, PolkadotPrimitivesV1UpgradeRestriction, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpTrieStorageProof, SpVersionRuntimeVersion, UniqueRuntimeRuntime, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateNftData, UpDataStructsCreateReFungibleData, UpDataStructsMetaUpdatePermission, UpDataStructsSchemaVersion, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './unique';5import type { Data, StorageKey } from '@polkadot/types';5import type { Data, StorageKey } from '@polkadot/types';6import type { BitVec, Bool, Bytes, I128, I16, I256, I32, I64, I8, Json, Null, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec';6import type { BitVec, Bool, Bytes, I128, I16, I256, I32, I64, I8, Json, Null, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec';7import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets';7import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets';1167 UpDataStructsCreateReFungibleData: UpDataStructsCreateReFungibleData;1167 UpDataStructsCreateReFungibleData: UpDataStructsCreateReFungibleData;1168 UpDataStructsMetaUpdatePermission: UpDataStructsMetaUpdatePermission;1168 UpDataStructsMetaUpdatePermission: UpDataStructsMetaUpdatePermission;1169 UpDataStructsSchemaVersion: UpDataStructsSchemaVersion;1169 UpDataStructsSchemaVersion: UpDataStructsSchemaVersion;1170 UpDataStructsSponsoringRateLimit: UpDataStructsSponsoringRateLimit;1170 UpDataStructsSponsorshipState: UpDataStructsSponsorshipState;1171 UpDataStructsSponsorshipState: UpDataStructsSponsorshipState;1171 UpgradeGoAhead: UpgradeGoAhead;1172 UpgradeGoAhead: UpgradeGoAhead;1172 UpgradeRestriction: UpgradeRestriction;1173 UpgradeRestriction: UpgradeRestriction;tests/src/interfaces/types-lookup.tsdiffbeforeafterboth1513 readonly type: 'ImageURL' | 'Unique';1513 readonly type: 'ImageURL' | 'Unique';1514 }1514 }15151516 /** @name UpDataStructsSponsoringRateLimit */1517 export interface UpDataStructsSponsoringRateLimit extends Enum {1518 readonly isSponsoringDisabled: boolean;1519 readonly isBlocks: boolean;1520 readonly asBlocks: u32;1521 readonly type: 'SponsoringDisabled' | 'Blocks';1522 }151515231516 /** @name UpDataStructsCollectionLimits (163) */1524 /** @name UpDataStructsCollectionLimits (163) */1517 export interface UpDataStructsCollectionLimits extends Struct {1525 export interface UpDataStructsCollectionLimits extends Struct {1518 readonly accountTokenOwnershipLimit: Option<u32>;1526 readonly accountTokenOwnershipLimit: Option<u32>;1519 readonly sponsoredDataSize: Option<u32>;1527 readonly sponsoredDataSize: Option<u32>;1520 readonly sponsoredDataRateLimit: Option<Option<u32>>;1528 readonly sponsoredDataRateLimit: Option<UpDataStructsSponsoringRateLimit>;1521 readonly tokenLimit: Option<u32>;1529 readonly tokenLimit: Option<u32>;1522 readonly sponsorTransferTimeout: Option<u32>;1530 readonly sponsorTransferTimeout: Option<u32>;1523 readonly sponsorApproveTimeout: Option<u32>;1531 readonly sponsorApproveTimeout: Option<u32>;tests/src/interfaces/unique/types.tsdiffbeforeafterboth1720export interface UpDataStructsCollectionLimits extends Struct {1720export interface UpDataStructsCollectionLimits extends Struct {1721 readonly accountTokenOwnershipLimit: Option<u32>;1721 readonly accountTokenOwnershipLimit: Option<u32>;1722 readonly sponsoredDataSize: Option<u32>;1722 readonly sponsoredDataSize: Option<u32>;1723 readonly sponsoredDataRateLimit: Option<Option<u32>>;1723 readonly sponsoredDataRateLimit: Option<UpDataStructsSponsoringRateLimit>;1724 readonly tokenLimit: Option<u32>;1724 readonly tokenLimit: Option<u32>;1725 readonly sponsorTransferTimeout: Option<u32>;1725 readonly sponsorTransferTimeout: Option<u32>;1726 readonly sponsorApproveTimeout: Option<u32>;1726 readonly sponsorApproveTimeout: Option<u32>;1805 readonly type: 'ImageURL' | 'Unique';1805 readonly type: 'ImageURL' | 'Unique';1806}1806}18071808/** @name UpDataStructsSponsoringRateLimit */1809export interface UpDataStructsSponsoringRateLimit extends Enum {1810 readonly isSponsoringDisabled: boolean;1811 readonly isBlocks: boolean;1812 readonly asBlocks: u32;1813}180718141808/** @name UpDataStructsSponsorshipState */1815/** @name UpDataStructsSponsorshipState */1809export interface UpDataStructsSponsorshipState extends Enum {1816export interface UpDataStructsSponsorshipState extends Enum {tests/src/setVariableMetadataSponsoringRateLimit.test.tsdiffbeforeafterboth4//4//556import {IKeyringPair} from '@polkadot/types/types';6import {IKeyringPair} from '@polkadot/types/types';7import {expect} from 'chai';7import privateKey from './substrate/privateKey';8import privateKey from './substrate/privateKey';8import usingApi from './substrate/substrate-api';9import usingApi from './substrate/substrate-api';9import {10import {10 confirmSponsorshipExpectSuccess,11 confirmSponsorshipExpectSuccess,11 createCollectionExpectSuccess,12 createCollectionExpectSuccess,12 createItemExpectSuccess,13 createItemExpectSuccess,13 findUnusedAddress,14 findUnusedAddress,15 getDetailedCollectionInfo,14 setCollectionLimitsExpectSuccess,16 setCollectionLimitsExpectSuccess,15 setCollectionSponsorExpectSuccess,17 setCollectionSponsorExpectSuccess,16 setVariableMetaDataExpectFailure,18 setVariableMetaDataExpectFailure,33 await setCollectionSponsorExpectSuccess(collectionId, alice.address);35 await setCollectionSponsorExpectSuccess(collectionId, alice.address);34 await confirmSponsorshipExpectSuccess(collectionId);36 await confirmSponsorshipExpectSuccess(collectionId);35 await setCollectionLimitsExpectSuccess(alice, collectionId, {37 await setCollectionLimitsExpectSuccess(alice, collectionId, {36 sponsoredDataRateLimit: 0,38 sponsoredDataRateLimit: {Blocks: 0},37 });39 });384039 const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', userWithNoBalance.address);41 const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', userWithNoBalance.address);46 await setCollectionSponsorExpectSuccess(collectionId, alice.address);48 await setCollectionSponsorExpectSuccess(collectionId, alice.address);47 await confirmSponsorshipExpectSuccess(collectionId);49 await confirmSponsorshipExpectSuccess(collectionId);48 await setCollectionLimitsExpectSuccess(alice, collectionId, {50 await setCollectionLimitsExpectSuccess(alice, collectionId, {49 sponsoredDataRateLimit: 10,51 sponsoredDataRateLimit: {Blocks: 10},50 });52 });515352 const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', userWithNoBalance.address);54 const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', userWithNoBalance.address);59 await setCollectionSponsorExpectSuccess(collectionId, alice.address);61 await setCollectionSponsorExpectSuccess(collectionId, alice.address);60 await confirmSponsorshipExpectSuccess(collectionId);62 await confirmSponsorshipExpectSuccess(collectionId);61 await setCollectionLimitsExpectSuccess(alice, collectionId, {63 await setCollectionLimitsExpectSuccess(alice, collectionId, {62 sponsoredDataRateLimit: 0,64 sponsoredDataRateLimit: {Blocks: 0},63 sponsoredDataSize: 1,65 sponsoredDataSize: 1,64 });66 });65 const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', userWithNoBalance.address);67 const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', userWithNoBalance.address);77 await setVariableMetaDataExpectFailure(userWithNoBalance, collectionId, itemId, [1]);79 await setVariableMetaDataExpectFailure(userWithNoBalance, collectionId, itemId, [1]);78 });80 });798182 it('sponsoring of data is disabled by default', async () => {83 await usingApi(async api => {84 const collectionId = await createCollectionExpectSuccess();8586 const collection = (await getDetailedCollectionInfo(api, collectionId))!;87 // limit is none = default is used88 expect(collection?.limits.sponsoredDataRateLimit.isNone);89 });90 });9192 it('sponsoring can be disabled explicitly', async () => {93 await usingApi(async api => {94 const collectionId = await createCollectionExpectSuccess();9596 await setCollectionLimitsExpectSuccess(alice, collectionId, {sponsoredDataRateLimit: {Blocks: 6}});97 {98 const collection = (await getDetailedCollectionInfo(api, collectionId))!;99 expect(collection?.limits.sponsoredDataRateLimit.unwrap().asBlocks.toNumber()).to.equal(6);100 }101102 await setCollectionLimitsExpectSuccess(alice, collectionId, {sponsoredDataRateLimit: 'SponsoringDisabled'});103 {104 const collection = (await getDetailedCollectionInfo(api, collectionId))!;105 // disabled sponsoring = default value106 expect(collection?.limits.sponsoredDataRateLimit.unwrap().isNone).to.true;107 }108 });109 });80});110});81111