From da64379eeffcd8b1c5dc373167be3e4c909905a9 Mon Sep 17 00:00:00 2001 From: anastasia prasolova Date: Thu, 30 Dec 2021 16:52:45 +0300 Subject: [PATCH] initializing morph contracts on demand Signed-off-by: anastasia prasolova --- robot/resources/lib/python/payment_neogo.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/robot/resources/lib/python/payment_neogo.py b/robot/resources/lib/python/payment_neogo.py index 3ccb8d1..093cfd4 100644 --- a/robot/resources/lib/python/payment_neogo.py +++ b/robot/resources/lib/python/payment_neogo.py @@ -14,10 +14,6 @@ import contract ROBOT_AUTO_KEYWORDS = False -NNS_CONTRACT = contract.get_nns_contract_hash(NEOFS_NEO_API_ENDPOINT) -BALANCE_CONTRACT_HASH = contract.get_morph_contract_hash( - 'balance.neofs', NNS_CONTRACT, NEOFS_NEO_API_ENDPOINT - ) MORPH_TOKEN_POWER = 12 morph_rpc_cli = rpc_client.RPCClient(NEOFS_NEO_API_ENDPOINT) @@ -75,7 +71,9 @@ def get_balance(wif: str): ] try: resp = morph_rpc_cli.invoke_function( - BALANCE_CONTRACT_HASH, 'balanceOf', payload + contract.get_balance_contract_hash(NEOFS_NEO_API_ENDPOINT), + 'balanceOf', + payload ) logger.info(resp) value = int(resp['stack'][0]['value'])