func ReadTxSignAndBroadcast(txe *exec.TxExecution, err error) error {
	// if there's an error just return.
	if err != nil {
		return err
	}

	// if there is nothing to unpack then just return.
	if txe == nil {
		return nil
	}

	// Unpack and display for the user.
	height := fmt.Sprintf("%d", txe.Height)

	if txe.Receipt.CreatesContract {
		log.WithField("addr", txe.Receipt.ContractAddress).Warn()
		log.WithField("txHash", txe.TxHash).Info()
	} else {
		log.WithField("=>", txe.TxHash).Warn("Transaction Hash")
		log.WithField("=>", height).Debug("Block height")
		ret := txe.GetResult().GetReturn()
		if len(ret) != 0 {
			log.WithField("=>", hex.EncodeUpperToString(ret)).Warn("Return Value")
			log.WithField("=>", txe.Exception).Debug("Exception")
		}
	}

	return nil
}
// This is a closer function which is called by most of the tx_run functions
This is a closer function which is called by most of the tx_run functions
// This is a closer function which is called by most of the tx_run functions
func ReadTxSignAndBroadcast(txe *exec.TxExecution, err error) error {
	if err != nil {
		return err
	}
	if txe == nil {
		return nil
	}
	height := fmt.Sprintf("%d", txe.Height)
	if txe.Receipt.CreatesContract {
		log.WithField("addr", txe.Receipt.ContractAddress).Warn()
		log.WithField("txHash", txe.TxHash).Info()
	} else {
		log.WithField("=>", txe.TxHash).Warn("Transaction Hash")
		log.WithField("=>", height).Debug("Block height")
		ret := txe.GetResult().GetReturn()
		if len(ret) != 0 {
			log.WithField("=>", hex.EncodeUpperToString(ret)).Warn("Return Value")
			log.WithField("=>", txe.Exception).Debug("Exception")
		}
	}
	return nil
}
func ReadTxSignAndBroadcast ( txe * exec . TxExecution , err error ) error { if err != nil { return err } if txe == nil { return nil } height := fmt . Sprintf ( " " , txe . Height ) if txe . Receipt . CreatesContract { log . WithField ( " " , txe . Receipt . ContractAddress ) . Warn ( ) log . WithField ( " " , txe . TxHash ) . Info ( ) } else { log . WithField ( " " , txe . TxHash ) . Warn ( " " ) log . WithField ( " " , height ) . Debug ( " " ) ret := txe . GetResult ( ) . GetReturn ( ) if len ( ret ) != 0 { log . WithField ( " " , hex . EncodeUpperToString ( ret ) ) . Warn ( " " ) log . WithField ( " " , txe . Exception ) . Debug ( " " ) } } return nil }
This is a closer function which is called by most of the tx_run functions
This is a closer function which is called by most of the tx_run functions
// if there's an error just return. // if there is nothing to unpack then just return. // Unpack and display for the user.