Exemplo n.º 1
0
 public IKzWriter AddTo(IKzWriter writer)
 {
     writer
         .Add(_prevout)
         .Add(_scriptSig)
         .Add(_sequence);
     return writer;
 }
Exemplo n.º 2
0
 public IKzWriter AddTo(IKzWriter writer)
 {
     writer
     .Add(_value)
     .Add(_scriptPub)
     ;
     return(writer);
 }
Exemplo n.º 3
0
 public IKzWriter AddTo(IKzWriter w)
 {
     w.Add((byte)_code);
     if (_code >= KzOpcode.OP_PUSHDATA1 && _code <= KzOpcode.OP_PUSHDATA4)
     {
         var lengthBytes = BitConverter.GetBytes((uint)_data.Length).AsSpan(0, LengthBytesCount);
         w.Add(lengthBytes);
     }
     if (_data.Length > 0)
     {
         w.Add(_data.Sequence);
     }
     return(w);
 }
Exemplo n.º 4
0
 public IKzWriter AddTo(IKzWriter writer, bool withoutCodeSeparators = false)
 {
     if (withoutCodeSeparators)
     {
         var ops = Decode().Where(o => o.Code != KzOpcode.OP_CODESEPARATOR).ToArray();
         writer.Add(ops.Length.AsVarIntBytes());
         foreach (var op in ops)
         {
             writer.Add(op);
         }
     }
     else
     {
         writer
         .Add(_script.Length.AsVarIntBytes())
         .Add(_script);
     }
     return(writer);
 }
Exemplo n.º 5
0
 public static IKzWriter Add(this IKzWriter w, KzOp op) => op.AddTo(w);
Exemplo n.º 6
0
 public static IKzWriter Add(this IKzWriter w, KzTransaction tx) => tx.AddTo(w);
Exemplo n.º 7
0
 public static IKzWriter Add(this IKzWriter w, KzTxOut txOut) => txOut.AddTo(w);
Exemplo n.º 8
0
 public static IKzWriter Add(this IKzWriter w, KzTxIn txIn) => txIn.AddTo(w);
Exemplo n.º 9
0
 public static IKzWriter Add(this IKzWriter w, KzScript script, bool withoutCodeSeparators = false) => script.AddTo(w, withoutCodeSeparators);
Exemplo n.º 10
0
 public IKzWriter AddTo(IKzWriter w)
 {
     w.Add(_txid).Add(_n);
     return(w);
 }
Exemplo n.º 11
0
 public IKzWriter AddTo(IKzWriter w)
 {
     w.Add(_HashTx).Add(_N);
     return(w);
 }