示例#1
0
 public void MergeFrom(Transaction other)
 {
     if (other == null)
     {
         return;
     }
     if (other.Hash.Length != 0)
     {
         Hash = other.Hash;
     }
     if (other.From.Length != 0)
     {
         From = other.From;
     }
     if (other.To.Length != 0)
     {
         To = other.To;
     }
     if (other.Value.Length != 0)
     {
         Value = other.Value;
     }
     if (other.Nonce != 0UL)
     {
         Nonce = other.Nonce;
     }
     if (other.Timestamp != 0L)
     {
         Timestamp = other.Timestamp;
     }
     if (other.data_ != null)
     {
         if (data_ == null)
         {
             data_ = new global::Corepb.Data();
         }
         Data.MergeFrom(other.Data);
     }
     if (other.ChainId != 0)
     {
         ChainId = other.ChainId;
     }
     if (other.GasPrice.Length != 0)
     {
         GasPrice = other.GasPrice;
     }
     if (other.GasLimit.Length != 0)
     {
         GasLimit = other.GasLimit;
     }
     if (other.Alg != 0)
     {
         Alg = other.Alg;
     }
     if (other.Sign.Length != 0)
     {
         Sign = other.Sign;
     }
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
示例#2
0
        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;

            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                    break;

                case 10: {
                    Hash = input.ReadBytes();
                    break;
                }

                case 18: {
                    From = input.ReadBytes();
                    break;
                }

                case 26: {
                    To = input.ReadBytes();
                    break;
                }

                case 34: {
                    Value = input.ReadBytes();
                    break;
                }

                case 40: {
                    Nonce = input.ReadUInt64();
                    break;
                }

                case 48: {
                    Timestamp = input.ReadInt64();
                    break;
                }

                case 58: {
                    if (data_ == null)
                    {
                        data_ = new global::Corepb.Data();
                    }
                    input.ReadMessage(data_);
                    break;
                }

                case 64: {
                    ChainId = input.ReadUInt32();
                    break;
                }

                case 74: {
                    GasPrice = input.ReadBytes();
                    break;
                }

                case 82: {
                    GasLimit = input.ReadBytes();
                    break;
                }

                case 88: {
                    Alg = input.ReadUInt32();
                    break;
                }

                case 98: {
                    Sign = input.ReadBytes();
                    break;
                }
                }
            }
        }