Skip to content

Commit

Permalink
Fix batch mint utility
Browse files Browse the repository at this point in the history
  • Loading branch information
enjinabner committed Oct 25, 2024
1 parent c4ef1e3 commit 2edd6e0
Showing 1 changed file with 7 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Enjin\Platform\GraphQL\Types\Input\Substrate\Traits\HasSimulateField;
use Enjin\Platform\Interfaces\PlatformBlockchainTransaction;
use Enjin\Platform\Interfaces\PlatformGraphQlMutation;
use Enjin\Platform\Models\Substrate\MintParams;
use Enjin\Platform\Models\Transaction;
use Enjin\Platform\Rules\CheckTokenCount;
use Enjin\Platform\Rules\IsCollectionOwner;
Expand Down Expand Up @@ -156,21 +155,13 @@ public static function getEncodableParams(...$params): array

if ($continueOnFailure) {
$encodedData = collect($recipients)->map(
function ($recipient) use ($serializationService, $collectionId) {
$data = $serializationService->encode('Mint', [
'collectionId' => gmp_init($collectionId),
'recipient' => [
'Id' => HexConverter::unPrefix($recipient['accountId']),
],
'params' => $recipient['params']->toEncodable(),
]);

if ($recipient['params'] instanceof MintParams) {
return $data;
}

return isRunningLatest() ? $data . '00000000' : $data;
}
fn ($recipient) => $serializationService->encode('Mint', [
'collectionId' => gmp_init($collectionId),
'recipient' => [
'Id' => HexConverter::unPrefix($recipient['accountId']),
],
'params' => $recipient['params']->toEncodable(),
])
);

return [
Expand Down

0 comments on commit 2edd6e0

Please sign in to comment.