How to use the electrumx.lib.util.cachedproperty function in electrumX

To help you get started, we’ve selected a few electrumX examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kyuupichan / electrumx / tests / lib / test_util.py View on Github external
        @util.cachedproperty
        def cls_prop(cls):
            cls.CALL_COUNT += 1
            return cls.CALL_COUNT
github kyuupichan / electrumx / tests / lib / test_util.py View on Github external
        @util.cachedproperty
        def prop(self):
            self.call_count += 1
            return self.call_count
github kyuupichan / electrumx / electrumx / lib / peer.py View on Github external
    @cachedproperty
    def server_version(self):
        '''Returns the server version as a string if known, otherwise None.'''
        return self._string('server_version')
github kyuupichan / electrumx / electrumx / lib / peer.py View on Github external
    @cachedproperty
    def protocol_min(self):
        '''Minimum protocol version as a string, e.g., 1.0'''
        return self._protocol_version_string('protocol_min')
github kyuupichan / electrumx / electrumx / lib / peer.py View on Github external
    @cachedproperty
    def genesis_hash(self):
        '''Returns the network genesis block hash as a string if known, otherwise None.'''
        return self._string('genesis_hash')
github kyuupichan / electrumx / electrumx / wallet / bip32.py View on Github external
    @cachedproperty
    def public_key(self):
        '''Return the corresponding extended public key.'''
        verifying_key = self.signing_key.get_verifying_key()
        parent_pubkey = self.parent.public_key if self.parent else None
        return PubKey(verifying_key, self.chain_code, self.n, self.depth,
                      parent_pubkey)
github kyuupichan / electrumx / electrumx / wallet / bip32.py View on Github external
    @cachedproperty
    def privkey_bytes(self):
        '''Return the serialized private key (no leading zero byte).'''
        return _exponent_to_bytes(self.secret_exponent())
github kyuupichan / electrumx / electrumx / lib / peer.py View on Github external
    @cachedproperty
    def pruning(self):
        '''Returns the pruning level as an integer.  None indicates no
        pruning.'''
        pruning = self._integer('pruning')
        if pruning and pruning > 0:
            return pruning
        return None
github kyuupichan / electrumx / electrumx / lib / peer.py View on Github external
    @cachedproperty
    def ip_address(self):
        '''The host as a python ip_address object, or None.'''
        try:
            return ip_address(self.host)
        except ValueError:
            return None
github kyuupichan / electrumx / electrumx / lib / peer.py View on Github external
    @cachedproperty
    def tcp_port(self):
        '''Returns None if no TCP port, otherwise the port as an integer.'''
        return self._port('tcp_port')