示例#1
0
    def encode(kwargs_protobuf_object: Any, kwargs_object: "Kwargs") -> None:
        """
        Encode an instance of this class into the protocol buffer object.

        The protocol buffer object in the kwargs_protobuf_object argument is matched with the instance of this class in the 'kwargs_object' argument.

        :param kwargs_protobuf_object: the protocol buffer object whose type corresponds with this class.
        :param kwargs_object: an instance of this class to be encoded in the protocol buffer object.
        :return: None
        """
        kwargs_protobuf_object.kwargs = DictProtobufStructSerializer.encode(
            kwargs_object.body)
示例#2
0
    def encode(agents_info_protobuf_object: Any,
               agents_info_object: "AgentsInfo") -> None:
        """
        Encode an instance of this class into the protocol buffer object.

        The protocol buffer object in the agents_info_protobuf_object argument is matched with the instance of this class in the 'agents_info_object' argument.

        :param agents_info_protobuf_object: the protocol buffer object whose type corresponds with this class.
        :param agents_info_object: an instance of this class to be encoded in the protocol buffer object.
        :return: None
        """
        agents_info_protobuf_object.agents_info = DictProtobufStructSerializer.encode(
            agents_info_object.body)
示例#3
0
    def encode(state_protobuf_object, state_object: "State") -> None:
        """
        Encode an instance of this class into the protocol buffer object.

        The protocol buffer object in the state_protobuf_object argument must be matched with the instance of this class in the 'state_object' argument.

        :param state_protobuf_object: the protocol buffer object whose type corresponds with this class.
        :param state_object: an instance of this class to be encoded in the protocol buffer object.
        :return: None
        """
        state_dict = {
            "ledger_id": state_object.ledger_id,
            "body": state_object.body,
        }

        state_protobuf_object.state = DictProtobufStructSerializer.encode(
            state_dict)
示例#4
0
    def encode(raw_transaction_protobuf_object,
               raw_transaction_object: "RawTransaction") -> None:
        """
        Encode an instance of this class into the protocol buffer object.

        The protocol buffer object in the raw_transaction_protobuf_object argument must be matched with the instance of this class in the 'raw_transaction_object' argument.

        :param raw_transaction_protobuf_object: the protocol buffer object whose type corresponds with this class.
        :param raw_transaction_object: an instance of this class to be encoded in the protocol buffer object.
        :return: None
        """

        raw_transaction_dict = {
            "ledger_id": raw_transaction_object.ledger_id,
            "body": raw_transaction_object.body,
        }

        raw_transaction_protobuf_object.raw_transaction = DictProtobufStructSerializer.encode(
            raw_transaction_dict)
示例#5
0
    def encode(signed_message_protobuf_object,
               signed_message_object: "SignedMessage") -> None:
        """
        Encode an instance of this class into the protocol buffer object.

        The protocol buffer object in the signed_message_protobuf_object argument must be matched with the instance of this class in the 'signed_message_object' argument.

        :param signed_message_protobuf_object: the protocol buffer object whose type corresponds with this class.
        :param signed_message_object: an instance of this class to be encoded in the protocol buffer object.
        :return: None
        """
        signed_message_dict = {
            "ledger_id": signed_message_object.ledger_id,
            "body": signed_message_object.body,
            "is_deprecated_mode": signed_message_object.is_deprecated_mode,
        }

        signed_message_protobuf_object.signed_message = DictProtobufStructSerializer.encode(
            signed_message_dict)
示例#6
0
    def encode(
        transaction_digest_protobuf_object,
        transaction_digest_object: "TransactionDigest",
    ) -> None:
        """
        Encode an instance of this class into the protocol buffer object.

        The protocol buffer object in the transaction_digest_protobuf_object argument must be matched with the instance of this class in the 'transaction_digest_object' argument.

        :param transaction_digest_protobuf_object: the protocol buffer object whose type corresponds with this class.
        :param transaction_digest_object: an instance of this class to be encoded in the protocol buffer object.
        :return: None
        """
        transaction_digest_dict = {
            "ledger_id": transaction_digest_object.ledger_id,
            "body": transaction_digest_object.body,
        }

        transaction_digest_protobuf_object.transaction_digest = DictProtobufStructSerializer.encode(
            transaction_digest_dict)
示例#7
0
    def encode(
        signed_transaction_protobuf_object: Any,
        signed_transaction_object: "SignedTransaction",
    ) -> None:
        """
        Encode an instance of this class into the protocol buffer object.

        The protocol buffer object in the signed_transaction_protobuf_object argument must be matched with the instance of this class in the 'signed_transaction_object' argument.

        :param signed_transaction_protobuf_object: the protocol buffer object whose type corresponds with this class.
        :param signed_transaction_object: an instance of this class to be encoded in the protocol buffer object.
        :return: None
        """
        signed_transaction_dict = {
            "ledger_id": signed_transaction_object.ledger_id,
            "body": signed_transaction_object.body,
        }

        signed_transaction_protobuf_object.signed_transaction = DictProtobufStructSerializer.encode(
            signed_transaction_dict)
示例#8
0
    def encode(terms_protobuf_object, terms_object: "Terms") -> None:
        """
        Encode an instance of this class into the protocol buffer object.

        The protocol buffer object in the terms_protobuf_object argument must be matched with the instance of this class in the 'terms_object' argument.

        :param terms_protobuf_object: the protocol buffer object whose type corresponds with this class.
        :param terms_object: an instance of this class to be encoded in the protocol buffer object.
        :return: None
        """
        terms_dict = {
            "ledger_id": terms_object.ledger_id,
            "sender_address": terms_object.sender_address,
            "counterparty_address": terms_object.counterparty_address,
            "amount_by_currency_id": terms_object.amount_by_currency_id,
            "quantities_by_good_id": terms_object.quantities_by_good_id,
            "nonce": terms_object.nonce,
            "is_sender_payable_tx_fee": terms_object.is_sender_payable_tx_fee,
            "fee_by_currency_id": terms_object.fee_by_currency_id,
            "is_strict": terms_object.is_strict,
            "kwargs": terms_object.kwargs,
        }
        terms_protobuf_object.terms = DictProtobufStructSerializer.encode(
            terms_dict)