Serialize the model instance as an OutgoingTransaction.

    Skip those not registered.
502187
def serialize_on_save(sender, instance, raw, created, using, **kwargs):
    
    if not raw:
        if "historical" not in instance._meta.label_lower:
            try:
                wrapped_instance = site_offline_models.get_wrapped_instance(instance)
            except ModelNotRegistered:
                pass
            else:
                wrapped_instance.to_outgoing_transaction(using, created=created)
570775
def serialize(self, value, entity=None, request=None):
    

    ret = self.from_python(value)
    self.validate(ret)
    self.run_validators(value)
    return ret
1047191
protected void sendTransacted(Destination destination, Serializable message) {
        send(destination, message, null, null, true);
    }
1328042
public function serialize()
    {
        if ($this->inTransaction()) {
            throw new \RuntimeException('Can not serialize in transaction');
        }
        return serialize(array(
            $this->dsn,
            $this->user,
            $this->password,
            $this->options,
        ));
    }
1260482
def serialize_history_on_post_create(history_instance, using, **kwargs):
    
    try:
        wrapped_instance = site_offline_models.get_wrapped_instance(history_instance)
    except ModelNotRegistered:
        pass
    else:
        wrapped_instance.to_outgoing_transaction(using, created=True)
742565
public T withOutgoingPayload(Map<String, ByteBuffer> outgoingPayload) {
        getOptions().setOutgoingPayLoad(Optional.of(outgoingPayload));
        return getThis();
    }
924761
function TransactionBuilder(apiClient) {
    
    if (typeof apiClient.namespace === "undefined" || apiClient.namespace === null) {
        throw new Error("The API client has not been initialized");
    }
    
    this.client = apiClient;
    this.records = [];
    this.keys = [];
    this.metadata = ByteBuffer.fromHex("");
}
693950
public synchronized void abortTransaction() throws TransactionNotInProgressException
    {
        if(isInTransaction())
        {
            fireBrokerEvent(BEFORE_ROLLBACK_EVENT);
            setInTransaction(false);
            clearRegistrationLists();
            referencesBroker.removePrefetchingListeners();
            /*
            arminw:
            check if we in local tx, before do local rollback
            Necessary, because ConnectionManager may do a rollback by itself
            or in managed environments the used connection is already be closed
            */
            if(connectionManager.isInLocalTransaction()) this.connectionManager.localRollback();
            fireBrokerEvent(AFTER_ROLLBACK_EVENT);
        }
    }
857545
def Serialize(self, writer):
        
        super(Block, self).Serialize(writer)
        writer.WriteSerializableArray(self.Transactions)
1317433
void forgetTransaction(Xid xid) {
      try {
         TransactionOperationFactory factory = assertStartedAndReturnFactory();
         ForgetTransactionOperation operation = factory.newForgetTransactionOperation(xid);
         //async.
         //we don't need the reply from server. If we can't forget for some reason (timeouts or other exception),
         // the server reaper will cleanup the completed transactions after a while. (default 1 min)
         operation.execute();
      } catch (Exception e) {
         if (isTraceLogEnabled()) {
            getLog().tracef(e, "Exception in forget transaction xid=%s", xid);
         }
      }
   }
303733
def DeserializeUnsignedWithoutType(self, reader):
        
        self.Version = reader.ReadByte()
        self.DeserializeExclusiveData(reader)
        self.Attributes = reader.ReadSerializableArray('neo.Core.TX.TransactionAttribute.TransactionAttribute',
                                                       max=self.MAX_TX_ATTRIBUTES)
        self.inputs = reader.ReadSerializableArray('neo.Core.CoinReference.CoinReference')
        self.outputs = reader.ReadSerializableArray('neo.Core.TX.Transaction.TransactionOutput')
527888
def transform_outgoing(self, son, collection):
        """"""
        if isinstance(son, dict):
            for (key, value) in son.items():
                if self.replacement in key:
                    k = self.revert_key(key)
                    son[k] = self.transform_outgoing(son.pop(key), collection)
                elif isinstance(value, dict):  # recurse into sub-docs
                    son[key] = self.transform_outgoing(value, collection)
                elif isinstance(value, list):
                    son[key] = [self.transform_outgoing(item, collection)
                                for item in value]
            return son
        elif isinstance(son, list):
            return [self.transform_outgoing(item, collection)
                    for item in son]
        else:
            return son
1020378
public TransactionWrapper getTransactionWrapper(Transaction t) {
    	if (t == null) {
    		return null;
    	}
    	final TransactionWrapperAppData twad = (TransactionWrapperAppData) t.getApplicationData();
    	return twad != null ? twad.getTransactionWrapper(t, this) : null;
	}
1238555
def unspent_outputs(self):
        
        if self.operation == Transaction.CREATE:
            self._asset_id = self._id
        elif self.operation == Transaction.TRANSFER:
            self._asset_id = self.asset['id']
        return (UnspentOutput(
            transaction_id=self._id,
            output_index=output_index,
            amount=output.amount,
            asset_id=self._asset_id,
            condition_uri=output.fulfillment.condition_uri,
        ) for output_index, output in enumerate(self.outputs))
95186
def copy(self, tx_ins=None, tx_outs=None, lock_time=None,
             expiry_height=None, value_balance=None, tx_shielded_spends=None,
             tx_shielded_outputs=None, tx_joinsplits=None,
             joinsplit_pubkey=None, joinsplit_sig=None, binding_sig=None):
        '''
        
        '''
        return SaplingTx(
            tx_ins=tx_ins if tx_ins is not None else self.tx_ins,
            tx_outs=tx_outs if tx_outs is not None else self.tx_outs,
            lock_time=(lock_time if lock_time is not None
                       else self.lock_time),
            expiry_height=(expiry_height if expiry_height is not None
                           else self.expiry_height),
            value_balance=(value_balance if value_balance is not None
                           else self.value_balance),
            tx_shielded_spends=(
                tx_shielded_spends if tx_shielded_spends is not None
                else self.tx_shielded_spends),
            tx_shielded_outputs=(
                tx_shielded_outputs if tx_shielded_outputs is not None
                else self.tx_shielded_outputs),
            tx_joinsplits=(tx_joinsplits if tx_joinsplits is not None
                           else self.tx_joinsplits),
            joinsplit_pubkey=(joinsplit_pubkey if joinsplit_pubkey is not None
                              else self.joinsplit_pubkey),
            joinsplit_sig=(joinsplit_sig if joinsplit_sig is not None
                           else self.joinsplit_sig),
            binding_sig=(binding_sig if binding_sig is not None
                         else self.binding_sig))
556921
def export_batch(self):
        
        batch = self.batch_cls(
            model=self.model, history_model=self.history_model, using=self.using
        )
        if batch.items:
            try:
                json_file = self.json_file_cls(batch=batch, path=self.path)
                json_file.write()
            except JSONDumpFileError as e:
                raise TransactionExporterError(e)
            batch.close()
            return batch
        return None
330368
def unserialize(self, data):
        

        # copy activity attributes into object
        if "author" not in data["object"]:
            data["object"]["author"] = data["actor"]
        for key in ["to", "cc", "bto", "bcc"]:
            if key not in data["object"] and key in data:
                data["object"][key] = data[key]

        Mapper(pypump=self._pump).parse_map(self, data=data)
        self._add_links(data)

        return self