Esempio n. 1
0
 /// <summary>
 /// Transform action data as packed binary format to object
 /// </summary>
 /// <param name="code"></param>
 /// <param name="action"></param>
 /// <param name="data"></param>
 /// <returns></returns>
 public async Task <object> AbiBinToJson(string code, string action, string data)
 {
     return((await Api.AbiBinToJson(new AbiBinToJsonRequest()
     {
         code = code,
         action = action,
         binargs = data
     })).args);
 }
Esempio n. 2
0
        public async Task AbiBinToJsonTest()
        {
            var abiBinToJsonParams = new AbiBinToJsonParams
            {
                Code    = ContractInfo.ContractName,
                Action  = CreatePostActionName,
                Binargs = "000000000090b1ca0a746573745f315f75726c0b746573745f315f68617368"
            };

            var resp = await Api.AbiBinToJson(abiBinToJsonParams, CancellationToken);

            TestPropetries(resp);
        }
Esempio n. 3
0
        public async Task AbiBinToJsonTest()
        {
            var abiBinToJsonParams = new AbiBinToJsonParams()
            {
                Code    = "hackathon",
                Action  = "transfer",
                Binargs = "000000008090b1ca000000008090b1cae8030000000000000056494d00000000"
            };

            var resp = await Api.AbiBinToJson(abiBinToJsonParams, CancellationToken.None);

            Console.WriteLine(resp.Error);
            Assert.IsTrue(resp.IsSuccess);
            Console.WriteLine(JsonConvert.SerializeObject(resp.Result));

            var obj = await Api.CustomPostRequest <JObject>("v1/chain/abi_bin_to_json", abiBinToJsonParams, CancellationToken.None);

            TestPropetries(resp.Result.GetType(), obj.Result);
            Console.WriteLine("----------------------------------------------------------------------------");
            Console.WriteLine(JsonConvert.SerializeObject(obj));
        }