예제 #1
0
        public void simple_synchronous_call_getblockdisplaydata_height_returns_result_with_proxy()
        {
            BlockClient      client = new BlockClient();
            BlockDisplayData block  = client.GetDisplayData(Network.Doge, 200000);

            Assert.IsNotNull(block);
            Assert.IsTrue(block.Status == Consts.Success);
            Assert.IsTrue(block.Data.Blockhash == "092fd3e76db5ff35fbfefe48d5c53ca26e799f0654a4036ddd5fd78de77418c2");
            Assert.IsTrue(block.Data.Size == 20686);
        }
예제 #2
0
        public void should_simple_synchronous_call_getblockdisplaydata_hash_with_bad_height_throws_exception()
        {
            BlockClient client = new BlockClient();
            ExceptionWithMessage <CommonError> typedException = null;

            try
            {
                client.GetDisplayData(Network.Doge, Consts.Wrong);
            }
            catch (Exception e)
            {
                typedException = e?.InnerException as ExceptionWithMessage <CommonError>;
            }
            Assert.IsNotNull(typedException);
            Assert.IsNotNull(typedException.ErrorMessage);
            Assert.IsTrue(typedException.ErrorMessage.Status == Consts.Fail);
        }