Esempio n. 1
0
        private static string forge_transaction(JObject op)
        {
            string res = forge_nat((ulong)operation_tags[op["kind"].ToString()]);

            res += forge_source(op["source"].ToString());
            res += forge_nat(op["fee"].Value <ulong>());
            res += forge_nat(op["counter"].Value <ulong>());
            res += forge_nat(op["gas_limit"].Value <ulong>());
            res += forge_nat(op["storage_limit"].Value <ulong>());
            res += forge_nat(op["amount"].Value <ulong>());
            res += ForgeAddress(op["destination"].ToString());

            if (op["parameters"] != null)
            {
                res += forge_bool(true);
                res += ForgeMichelson.forge_entrypoint(op["parameters"]["entrypoint"].Value <string>());
                res += forge_array(ForgeMichelson.forge_micheline(op["parameters"]["value"]));
            }
            else
            {
                res += forge_bool(false);
            }

            return(res);
        }
Esempio n. 2
0
        private static string ForgeTransaction(JObject op)
        {
            var res = ForgeNat((ulong)OperationTags[op["kind"].ToString()]);

            res += ForgeSource(op["source"].ToString());
            res += ForgeNat(op["fee"].Value <ulong>());
            res += ForgeNat(op["counter"].Value <ulong>());
            res += ForgeNat(op["gas_limit"].Value <ulong>());
            res += ForgeNat(op["storage_limit"].Value <ulong>());
            res += ForgeNat(op["amount"].Value <ulong>());
            res += ForgeAddress(op["destination"].ToString());

            if (op["parameters"] != null)
            {
                res += ForgeBool(true);
                res += ForgeMichelson.ForgeEntrypoint(op["parameters"]["entrypoint"].Value <string>());
                res += ForgeArray(ForgeMichelson.ForgeMicheline(op["parameters"]["value"]));
            }
            else
            {
                res += ForgeBool(false);
            }

            return(res);
        }