Skip to content

Commit

Permalink
Create HashgraphBatchNftTest.php
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsmithies committed Nov 17, 2022
1 parent 5dc2b81 commit 3b3596f
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions tests/HashgraphBatchNftTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php

namespace Trustenterprises\LaravelHashgraph\Tests;

use Trustenterprises\LaravelHashgraph\LaravelHashgraph;
use Trustenterprises\LaravelHashgraph\Models\NFT\BatchTransferNft;
use Trustenterprises\LaravelHashgraph\Models\NFT\ClaimNft;
use Trustenterprises\LaravelHashgraph\Models\NFT\MintToken;
use Trustenterprises\LaravelHashgraph\Models\NFT\NftMetadata;
use Trustenterprises\LaravelHashgraph\Models\NFT\NonFungibleToken;
use Trustenterprises\LaravelHashgraph\Models\NFT\TransferNft;

class HashgraphBatchNftTest extends TestCase
{
/**
* Attempt to send a pre-minted NFT
*
* @test-ignore
*/
public function attempt_batch_transfer()
{

$account = LaravelHashgraph::createAccount();

// Mirrornode ain't real time...
$nft_id = '0.0.48905313';
$batch_amount = 19;

$batch = new BatchTransferNft($nft_id, $account->getAccountId(), $batch_amount);

$result = LaravelHashgraph::batchTransferNonFungibleToken($batch);

$this->assertEquals($batch_amount, $result->getActualSent());
$this->assertEquals($batch_amount, $result->getExpected());
}

/**
* Attempt to send to many NFTs
*
* @test
*/
public function attempt_failed_too_many_batch_transfer()
{
$account = LaravelHashgraph::createAccount();

// Mirrornode ain't real time...
$nft_id = '0.0.48905313';
$batch_amount = 1009;

$batch = new BatchTransferNft($nft_id, $account->getAccountId(), $batch_amount);

$result = LaravelHashgraph::batchTransferNonFungibleToken($batch);

$this->assertEquals('The treasury does not hold the amount of NFTs of id ' . $nft_id . ' to do the required batch transfer', $result->getErrors()[0]);
}


}

0 comments on commit 3b3596f

Please sign in to comment.