Beispiel #1
0
 static byte[] ForgeDelegation(DelegationContent operation)
 {
     return(Bytes.Concat(
                ForgeMicheNat((int)OperationTag.Delegation),
                ForgeTzAddress(operation.Source),
                ForgeMicheNat(operation.Fee),
                ForgeMicheNat(operation.Counter),
                ForgeMicheNat(operation.GasLimit),
                ForgeMicheNat(operation.StorageLimit),
                ForgeDelegate(operation.Delegate)));
 }
Beispiel #2
0
        static byte[] ForgeDelegation(DelegationContent operation)
        {
            var res = ForgeNat(OperationTags[operation.Kind]);

            res = res.Concat(ForgeSource(operation.Source));
            res = res.Concat(ForgeNat(operation.Fee));
            res = res.Concat(ForgeNat(operation.Counter));
            res = res.Concat(ForgeNat(operation.GasLimit));
            res = res.Concat(ForgeNat(operation.StorageLimit));

            if (!string.IsNullOrWhiteSpace(operation.Delegate))
            {
                res = res.Concat(ForgeBool(true));
                res = res.Concat(ForgeSource(operation.Delegate));
            }
            else
            {
                res = res.Concat(ForgeBool(false));
            }

            return(res);
        }