Skip to content

Commit

Permalink
Fix EfinityUtility being renamed to MatrixUtility (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardocustodio authored Sep 15, 2023
1 parent 10d4a1e commit cc9b219
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Services/Processor/Substrate/Codec/Encoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function unapproveToken(string $collectionId, string $tokenId, string $op

public function batch(array $calls, bool $continueOnFailure): string
{
$callIndex = $this->callIndexes['EfinityUtility.batch'];
$callIndex = $this->callIndexes['MatrixUtility.batch'];
$numberOfCalls = $this->scaleInstance->createTypeByTypeString('Compact')->encode(count($calls));
$calls = str_replace('0x', '', implode('', $calls));
$continueOnFailure = $continueOnFailure ? '01' : '00';
Expand Down Expand Up @@ -462,7 +462,7 @@ protected function loadCallIndexes(): array
{
$metadata = Cache::remember(PlatformCache::METADATA->key(), 3600, function () {
if (app()->runningUnitTests()) {
return Metadata::v3014();
return Metadata::v604();
}

$blockchain = new SubstrateWebsocket();
Expand Down
4 changes: 2 additions & 2 deletions src/Support/Metadata.php

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tests/Unit/AddressTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ public function test_it_can_get_null_daemon_account()
* @test
* @define-env usesEnjinNetwork
*/
public function test_it_will_encode_efinity_address_if_polkadot_is_the_selected_chain()
public function test_it_will_encode_matrix_address_if_enjin_is_the_selected_chain()
{
$address = SS58Address::encode('d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d');

$this->assertEquals('exXZe1U9dLp78MhrMG2vT59vxBEE9qD7cDJ4pEnobvzG1Ly8R', $address);
$this->assertEquals('efTwqopZgd4Yqefg2NzVPW4THfFmsSsSbxTLN2uq7kmadDaC5', $address);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/EncodingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,7 @@ public function test_it_can_encode_efinity_utility_batch()
continueOnFailure: false,
);

$callIndex = $this->codec->encode()->callIndexes['EfinityUtility.batch'];
$callIndex = $this->codec->encode()->callIndexes['MatrixUtility.batch'];
$this->assertEquals(
"0x{$callIndex}0828040052e3c0eb993523286d19954c7e3ada6f791fa3f32764e44b9c1df0c2723bc15e0400fd03b67a0300000100a0724e18090000000000000000000000000000000028040052e3c0eb993523286d19954c7e3ada6f791fa3f32764e44b9c1df0c2723bc15e0400fd03b67a0300000100a0724e18090000000000000000000000000000000000",
$data
Expand Down

0 comments on commit cc9b219

Please sign in to comment.