public override void SaveToStream(Stream s) { using (BinaryWriter bw = new BinaryWriter(s, Encoding.ASCII, true)) { bw.Write(SignerAccount); bw.Write(TargetAccount); bw.Write(NumberOfOperations); bw.Write(Fee); Payload.SaveToStream(bw); AccountKey.SaveToStream(s, false); bw.Write(ChangeType); NewAccountKey.SaveToStream(s, false); NewName.SaveToStream(bw); bw.Write(NewType); Signature.SaveToStream(s); } }
public override byte[] GetHash() { using (MemoryStream ms = new MemoryStream()) { using (BinaryWriter bw = new BinaryWriter(ms)) { bw.Write(SignerAccount); bw.Write(TargetAccount); bw.Write(NumberOfOperations); bw.Write(Fee); Payload.SaveToStream(bw); AccountKey.SaveToStream(ms, false); bw.Write(ChangeType); NewAccountKey.SaveToStream(ms, false); NewName.SaveToStream(bw); bw.Write(NewType); return(ms.ToArray()); } } }