Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix source for batch transfer #98

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading