From dec731e516ebef42a077d261a2e17db7a6091564 Mon Sep 17 00:00:00 2001 From: Ekliptor Date: Tue, 6 Oct 2020 08:45:57 +0700 Subject: [PATCH] throw exception on missing SLP token decimals --- src/BlockchainApi/BchdProtoGatewayApi.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/BlockchainApi/BchdProtoGatewayApi.php b/src/BlockchainApi/BchdProtoGatewayApi.php index 2863810..9708102 100644 --- a/src/BlockchainApi/BchdProtoGatewayApi.php +++ b/src/BlockchainApi/BchdProtoGatewayApi.php @@ -229,7 +229,8 @@ protected function addTokenMetadata(SlpToken $token, array $bchdTokenMetadata): if (isset($typeInfo->decimals)) // not present with all tokens $token->decimals = $typeInfo->decimals; else - $token->decimals = 9; + //$token->decimals = 9; + throw new \Exception("SLP token must return number of decimals from BCHD - tokenID: $id"); // add the token type if (isset($meta->type1))