|
@@ -7,7 +7,6 @@ use frame_support::dispatch::DispatchError;
|
|
use frame_support::traits::Currency;
|
|
use frame_support::traits::Currency;
|
|
use frame_support::{StorageDoubleMap, StorageMap, StorageValue};
|
|
use frame_support::{StorageDoubleMap, StorageMap, StorageValue};
|
|
use frame_system::RawOrigin;
|
|
use frame_system::RawOrigin;
|
|
-use sp_runtime::SaturatedConversion;
|
|
|
|
use sp_std::collections::btree_map::BTreeMap;
|
|
use sp_std::collections::btree_map::BTreeMap;
|
|
use sp_std::collections::btree_set::BTreeSet;
|
|
use sp_std::collections::btree_set::BTreeSet;
|
|
use sp_std::iter::{repeat, FromIterator};
|
|
use sp_std::iter::{repeat, FromIterator};
|
|
@@ -25,8 +24,8 @@ use mocks::{
|
|
build_test_externalities, Balances, DataObjectDeletionPrize,
|
|
build_test_externalities, Balances, DataObjectDeletionPrize,
|
|
DefaultChannelDynamicBagNumberOfStorageBuckets, DefaultMemberDynamicBagNumberOfStorageBuckets,
|
|
DefaultChannelDynamicBagNumberOfStorageBuckets, DefaultMemberDynamicBagNumberOfStorageBuckets,
|
|
InitialStorageBucketsNumberForDynamicBag, MaxDataObjectSize, MaxDistributionBucketFamilyNumber,
|
|
InitialStorageBucketsNumberForDynamicBag, MaxDataObjectSize, MaxDistributionBucketFamilyNumber,
|
|
- MaxDistributionBucketNumberPerFamily, MaxNumberOfDataObjectsPerBag, MaxRandomIterationNumber,
|
|
|
|
- Storage, Test, ANOTHER_DISTRIBUTION_PROVIDER_ID, ANOTHER_STORAGE_PROVIDER_ID,
|
|
|
|
|
|
+ MaxDistributionBucketNumberPerFamily, MaxRandomIterationNumber, Storage, Test,
|
|
|
|
+ ANOTHER_DISTRIBUTION_PROVIDER_ID, ANOTHER_STORAGE_PROVIDER_ID,
|
|
DEFAULT_DISTRIBUTION_PROVIDER_ACCOUNT_ID, DEFAULT_DISTRIBUTION_PROVIDER_ID,
|
|
DEFAULT_DISTRIBUTION_PROVIDER_ACCOUNT_ID, DEFAULT_DISTRIBUTION_PROVIDER_ID,
|
|
DEFAULT_MEMBER_ACCOUNT_ID, DEFAULT_MEMBER_ID, DEFAULT_STORAGE_PROVIDER_ACCOUNT_ID,
|
|
DEFAULT_MEMBER_ACCOUNT_ID, DEFAULT_MEMBER_ID, DEFAULT_STORAGE_PROVIDER_ACCOUNT_ID,
|
|
DEFAULT_STORAGE_PROVIDER_ID, DISTRIBUTION_WG_LEADER_ACCOUNT_ID, STORAGE_WG_LEADER_ACCOUNT_ID,
|
|
DEFAULT_STORAGE_PROVIDER_ID, DISTRIBUTION_WG_LEADER_ACCOUNT_ID, STORAGE_WG_LEADER_ACCOUNT_ID,
|
|
@@ -1014,25 +1013,6 @@ fn upload_fails_with_empty_object_cid() {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
-#[test]
|
|
|
|
-fn upload_fails_with_max_data_object_size_exceeded() {
|
|
|
|
- build_test_externalities().execute_with(|| {
|
|
|
|
- let max_object_size = MaxNumberOfDataObjectsPerBag::get();
|
|
|
|
- let invalid_object_number: u8 = (max_object_size + 1).saturated_into();
|
|
|
|
-
|
|
|
|
- let upload_params = UploadParameters::<Test> {
|
|
|
|
- bag_id: BagId::<Test>::Static(StaticBagId::Council),
|
|
|
|
- deletion_prize_source_account_id: DEFAULT_MEMBER_ACCOUNT_ID,
|
|
|
|
- object_creation_list: create_data_object_candidates(1, invalid_object_number),
|
|
|
|
- expected_data_size_fee: Storage::data_object_per_mega_byte_fee(),
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- UploadFixture::default()
|
|
|
|
- .with_params(upload_params)
|
|
|
|
- .call_and_assert(Err(Error::<Test>::DataObjectsPerBagLimitExceeded.into()));
|
|
|
|
- });
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
#[test]
|
|
#[test]
|
|
fn upload_fails_with_insufficient_balance_for_deletion_prize() {
|
|
fn upload_fails_with_insufficient_balance_for_deletion_prize() {
|
|
build_test_externalities().execute_with(|| {
|
|
build_test_externalities().execute_with(|| {
|