Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardocustodio committed Mar 18, 2024
1 parent 914171f commit c49537e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
17 changes: 13 additions & 4 deletions src/Commands/RelayWatcher.php

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/Services/Processor/Substrate/DecoderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,21 @@ class DecoderService
{
protected DecoderClient $client;
protected string $host;
protected string $network;

public function __construct()
public function __construct(?string $network = null)
{
$this->client = new DecoderClient();
$this->host = config('enjin-platform.decoder_container');
$this->network = $network ?? config('enjin-platform.chains.network');
}

public function decode(string $type, string|array $bytes): ?array
{
try {
$result = $this->client->getClient()->post($this->host, [
$type === 'Extrinsics' ? 'extrinsics' : 'events' => $bytes,
'network' => config('enjin-platform.chains.network'),
'network' => $this->network,
]);

$data = $this->client->getResponse($result);
Expand Down

0 comments on commit c49537e

Please sign in to comment.