Skip to content

Commit

Permalink
Fix source for batch transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
enjinabner committed Sep 20, 2024
1 parent 3adb120 commit 097e639
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Commands/BatchProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Enjin\Platform\GraphQL\Schemas\Primary\Substrate\Mutations\BatchMintMutation;
use Enjin\Platform\Models\Token;
use Enjin\Platform\Services\Blockchain\Implementations\Substrate;
use Enjin\Platform\Services\Database\CollectionService;
use Enjin\Platform\Services\Database\TransactionService;
use Enjin\Platform\Services\Serialization\Interfaces\SerializationServiceInterface;
use Enjin\Platform\Support\Account;
Expand Down Expand Up @@ -159,9 +160,14 @@ protected function processBatch(BeamType $type): int
'tokenId' => ['integer' => $claim->token_chain_id],
'amount' => $claim->quantity,
'keepAlive' => false,
'source' => Account::daemonPublicKey() !== $claim->collection->owner->public_key
? $claim->collection->owner->public_key
: null,
'source' => match(true) {
resolve(CollectionService::class)->approvalExistsInCollection(
$collectionId,
Account::daemonPublicKey()
) => Account::daemonPublicKey(),
Account::daemonPublicKey() !== $claim->collection->owner->public_key => $claim->collection->owner->public_key,
default => null
},
])->toEncodable(),
];
} else {
Expand Down

0 comments on commit 097e639

Please sign in to comment.