Exemplo n.º 1
0
    def totalsupply(conf: dict):
        """Query total supply of ICX

        :param conf: totalsupply command configuration
        """
        icon_client = IconClient(conf['uri'])

        response = icon_client.send(IconJsonrpc.getTotalSupply())

        if "error" in response:
            print('Got an error response')
            print(json.dumps(response, indent=4))
        else:
            print(f'Total supply of ICX in hex: {response["result"]}')
            print(
                f'Total supply of ICX in decimal: {int(response["result"], 16)}'
            )

        return response
Exemplo n.º 2
0
 def test_getTotalSupply(self):
     request = IconJsonrpc.getTotalSupply()
     self.check_jsonschema_validation(request=request)