diff --git a/src/Commands/BatchProcess.php b/src/Commands/BatchProcess.php index 9ddabfd..b5a87f9 100644 --- a/src/Commands/BatchProcess.php +++ b/src/Commands/BatchProcess.php @@ -190,8 +190,8 @@ protected function processBatch(BeamType $type): int 'initialSupply' => $this->tokenCreatedCache[$key] ? null : $claim->quantity, 'amount' => $this->tokenCreatedCache[$key] ? $claim->quantity : null, 'cap' => [ - 'type' => $claim->quantity == 1 || $claim->collection?->force_single_mint ? TokenMintCapType::SINGLE_MINT->name : TokenMintCapType::INFINITE->name, - 'amount' => null, + 'type' => $claim->quantity == 1 || $claim->collection?->force_single_mint ? TokenMintCapType::COLLAPSING_SUPPLY->name : null, + 'amount' => $claim->collection?->force_single_mint ? 1 : null, ], 'listingForbidden' => false, 'behaviour' => null, diff --git a/src/Rules/TokensDoNotExistInBeam.php b/src/Rules/TokensDoNotExistInBeam.php index 27a9fbd..411de0a 100644 --- a/src/Rules/TokensDoNotExistInBeam.php +++ b/src/Rules/TokensDoNotExistInBeam.php @@ -68,7 +68,7 @@ public static function prepareStatement(?Model $beam, ?string $collectionId = nu collections.max_token_supply = '1' OR (collections.force_single_mint is true AND tokens.supply = '1') OR (tokens.cap='" . TokenMintCapType::SUPPLY->name . "' AND tokens.cap_supply = '1') - OR (tokens.cap='" . TokenMintCapType::SINGLE_MINT->name . "' AND tokens.supply = '1') + OR (tokens.cap='" . TokenMintCapType::COLLAPSING_SUPPLY->name . "' AND tokens.supply = '1') ) ")->when($beam, fn ($query) => $query->where('beam_claims.beam_id', $beam->id)); } diff --git a/tests/Feature/GraphQL/Mutations/UpdateBeamTest.php b/tests/Feature/GraphQL/Mutations/UpdateBeamTest.php index c7eef17..22e53ec 100644 --- a/tests/Feature/GraphQL/Mutations/UpdateBeamTest.php +++ b/tests/Feature/GraphQL/Mutations/UpdateBeamTest.php @@ -213,7 +213,7 @@ public function test_it_will_fail_existing_tokens(): void 'collection_id' => $this->collection->id, 'token_chain_id' => (string) fake()->unique()->numberBetween(2000), 'supply' => (string) $supply = 1, - 'cap' => TokenMintCapType::SINGLE_MINT->name, + 'cap' => TokenMintCapType::COLLAPSING_SUPPLY->name, 'cap_supply' => null, 'is_frozen' => false, 'unit_price' => (string) $unitPrice = fake()->numberBetween(1 / $supply * 10 ** 17), diff --git a/tests/Feature/Traits/CreateCollectionData.php b/tests/Feature/Traits/CreateCollectionData.php index 3a69f34..fb7f233 100644 --- a/tests/Feature/Traits/CreateCollectionData.php +++ b/tests/Feature/Traits/CreateCollectionData.php @@ -2,7 +2,6 @@ namespace Enjin\Platform\Beam\Tests\Feature\Traits; -use Enjin\Platform\Enums\Substrate\TokenMintCapType; use Enjin\Platform\Models\Collection; use Enjin\Platform\Models\Token; use Enjin\Platform\Models\TokenAccount; @@ -60,7 +59,7 @@ public function prepareCollectionData(?string $publicKey = null): void 'collection_id' => $this->collection->id, 'token_chain_id' => (string) fake()->unique()->numberBetween(2000), 'supply' => (string) $supply = fake()->numberBetween(1), - 'cap' => TokenMintCapType::INFINITE->name, + 'cap' => null, 'cap_supply' => null, 'is_frozen' => false, 'unit_price' => (string) $unitPrice = fake()->numberBetween(1 / $supply * 10 ** 17),