Module cardano.wt.whitelist.no_whitelist

Expand source code
import sys

"""
Representation of a non-existent whitelist (e.g., no mint restrictions).
"""
class NoWhitelist(object):

    def available(self, utxo_inputs):
        """
        Always return no limits (e.g., max integer)

        :param utxo_inputs: The UTXOs in the mint request's input transaction
            NOTE: These may be reference inputs! Proceed with caution + validate
        :return: sys.maxsize (always)
        """
        return sys.maxsize

    def is_whitelisted(self, object):
        """
        For whitelists, this is a bit of a polyglot function to determine
        whether an object (e.g., asset or address) is whitelisted.

        :param object: The generic object to be tested
        :return: True or False (True for base implementation always)
        """
        return True

    def consume(self, utxo_inputs, num_mints):
        """
        No-operation because there is no whitelist to be consumed.

        :param utxo_inputs: The UTXOs in the mint request's input transaction
            NOTE: These may be reference inputs! Proceed with caution + validate
        :param num_mints: How many mints were successfully processed
        """
        pass

    def validate(self):
        """
        No-operation because a nil whitelist is automatically valid.
        """
        pass

Classes

class NoWhitelist
Expand source code
class NoWhitelist(object):

    def available(self, utxo_inputs):
        """
        Always return no limits (e.g., max integer)

        :param utxo_inputs: The UTXOs in the mint request's input transaction
            NOTE: These may be reference inputs! Proceed with caution + validate
        :return: sys.maxsize (always)
        """
        return sys.maxsize

    def is_whitelisted(self, object):
        """
        For whitelists, this is a bit of a polyglot function to determine
        whether an object (e.g., asset or address) is whitelisted.

        :param object: The generic object to be tested
        :return: True or False (True for base implementation always)
        """
        return True

    def consume(self, utxo_inputs, num_mints):
        """
        No-operation because there is no whitelist to be consumed.

        :param utxo_inputs: The UTXOs in the mint request's input transaction
            NOTE: These may be reference inputs! Proceed with caution + validate
        :param num_mints: How many mints were successfully processed
        """
        pass

    def validate(self):
        """
        No-operation because a nil whitelist is automatically valid.
        """
        pass

Methods

def available(self, utxo_inputs)

Always return no limits (e.g., max integer)

:param utxo_inputs: The UTXOs in the mint request's input transaction NOTE: These may be reference inputs! Proceed with caution + validate :return: sys.maxsize (always)

Expand source code
def available(self, utxo_inputs):
    """
    Always return no limits (e.g., max integer)

    :param utxo_inputs: The UTXOs in the mint request's input transaction
        NOTE: These may be reference inputs! Proceed with caution + validate
    :return: sys.maxsize (always)
    """
    return sys.maxsize
def consume(self, utxo_inputs, num_mints)

No-operation because there is no whitelist to be consumed.

:param utxo_inputs: The UTXOs in the mint request's input transaction NOTE: These may be reference inputs! Proceed with caution + validate :param num_mints: How many mints were successfully processed

Expand source code
def consume(self, utxo_inputs, num_mints):
    """
    No-operation because there is no whitelist to be consumed.

    :param utxo_inputs: The UTXOs in the mint request's input transaction
        NOTE: These may be reference inputs! Proceed with caution + validate
    :param num_mints: How many mints were successfully processed
    """
    pass
def is_whitelisted(self, object)

For whitelists, this is a bit of a polyglot function to determine whether an object (e.g., asset or address) is whitelisted.

:param object: The generic object to be tested :return: True or False (True for base implementation always)

Expand source code
def is_whitelisted(self, object):
    """
    For whitelists, this is a bit of a polyglot function to determine
    whether an object (e.g., asset or address) is whitelisted.

    :param object: The generic object to be tested
    :return: True or False (True for base implementation always)
    """
    return True
def validate(self)

No-operation because a nil whitelist is automatically valid.

Expand source code
def validate(self):
    """
    No-operation because a nil whitelist is automatically valid.
    """
    pass