public byte[] TransactionArgumentToByte(TransactionArgumentLCS source)
        {
            var len = U32ToByte((uint)source.ArgType);

            byte[] data;
            switch (source.ArgType)
            {
            case Types.TransactionArgument.Types.ArgType.Address:
                data = LCSCore.LCSDeserialization(source.Address);
                return(len.Concat(data).ToArray());

            case Types.TransactionArgument.Types.ArgType.Bytearray:
                data = ByteArrayToByte(source.ByteArray);
                return(len.Concat(data).ToArray());

            case Types.TransactionArgument.Types.ArgType.String:
                data = StringToByte(source.String);
                return(len.Concat(data).ToArray());

            case Types.TransactionArgument.Types.ArgType.U64:
                data = BitConverter.GetBytes(source.U64);
                return(len.Concat(data).ToArray());
            }

            throw new InvalidOperationException();
        }
        public TransactionArgumentLCS GetTransactionArgument(byte[] source, ref int cursor)
        {
            var retVal = new TransactionArgumentLCS();

            retVal.ArgType = (Types.TransactionArgument.Types.ArgType)Read_u32(source, ref cursor);

            if (retVal.ArgType == Types.TransactionArgument.Types.ArgType.U64)
            {
                retVal.U64 = Read_u64(source, ref cursor);
            }
            else if (retVal.ArgType == Types.TransactionArgument.Types.ArgType.Address)
            {
                retVal.Address = source.LCSerialization <AddressLCS>(ref cursor);
            }
            else if (retVal.ArgType == Types.TransactionArgument.Types.ArgType.Bytearray)
            {
                retVal.ByteArray = source.LCSerialization <byte[]>(ref cursor);
            }
            else if (retVal.ArgType == Types.TransactionArgument.Types.ArgType.String)
            {
                retVal.String = source.LCSerialization <string>(ref cursor);
            }

            return(retVal);
        }