Example #1
0
        public void DecodeTest()
        {
            var raw = Utils.ToByteArray(
                "580190c810058e8836804c0457494343858c2068768b8af2885916981abf5a41053b1036621f429ae9d9a765b0e473b7e25a72463044022002820b9d119b36379549880aab3c1b37db117644637668438825bbf250408434022029840cdaeb3f525d59b79f82a0f549af15a991b8414ab8cf65452ba752b151f4");

            var decodedTx = new Wicc.Tx.DexCancelOrderTx();
            var serialize = new NBitcoin.Wicc.Commons.Serialize(raw);

            serialize.ReadWrite(decodedTx);

            var tx = new Wicc.Tx.DexCancelOrderTx()
            {
                TxUid       = new RegId(246966, 204),
                ValidHeight = 287888,
                Fees        = 100000,
                OrderId     = new uint256("725ae2b773e4b065a7d9e99a421f6236103b05415abf1a98165988f28a8b7668")
            };

            Assert.IsTrue(decodedTx.ValidHeight == tx.ValidHeight);
            Assert.IsTrue(decodedTx.Version == tx.Version);
            Assert.IsTrue(decodedTx.TxType == tx.TxType);
            Assert.IsTrue(decodedTx.TxUid == tx.TxUid);
            Assert.IsTrue(decodedTx.Fees == tx.Fees);
            Assert.IsTrue(decodedTx.OrderId == tx.OrderId);

            Assert.IsTrue(decodedTx.Signature.ToString() ==
                          "3044022002820b9d119b36379549880aab3c1b37db117644637668438825bbf250408434022029840cdaeb3f525d59b79f82a0f549af15a991b8414ab8cf65452ba752b151f4");
        }
Example #2
0
        public void DecodeTest()
        {
            var raw = Utils.ToByteArray(
                "57018d8128058cf53782080457494343858c2004575553440457494343aed6c100463044022049a09e0d951a58d9e9f3e45af6d5d70c3606c16f398e584eb7b6989f217e1311022027cc3872a1b0aef2fed5e26514f7075894df76a2c0a9e6eb36982209dfad92df");

            var decodedTx = new Wicc.Tx.DexSellMarketOrderTx();
            var serialize = new NBitcoin.Wicc.Commons.Serialize(raw);

            serialize.ReadWrite(decodedTx);

            var tx = new Wicc.Tx.DexSellMarketOrderTx()
            {
                TxUid       = new RegId(228151, 392),
                ValidHeight = 229672,
                Fees        = 100000,
                CoinSymbol  = new TokenSymbol("WUSD"),
                AssetSymbol = new TokenSymbol("WICC"),
                AssetAmount = 100000000,
            };

            Assert.IsTrue(decodedTx.ValidHeight == tx.ValidHeight);
            Assert.IsTrue(decodedTx.Version == tx.Version);
            Assert.IsTrue(decodedTx.TxType == tx.TxType);
            Assert.IsTrue(decodedTx.TxUid == tx.TxUid);
            Assert.IsTrue(decodedTx.Fees == tx.Fees);
            Assert.IsTrue(decodedTx.CoinSymbol == tx.CoinSymbol);
            Assert.IsTrue(decodedTx.AssetSymbol == tx.AssetSymbol);
            Assert.IsTrue(decodedTx.AssetAmount == tx.AssetAmount);
            Assert.IsTrue(decodedTx.Signature.ToString() == "3044022049a09e0d951a58d9e9f3e45af6d5d70c3606c16f398e584eb7b6989f217e1311022027cc3872a1b0aef2fed5e26514f7075894df76a2c0a9e6eb36982209dfad92df");
        }
        public void DecodeTest()
        {
            var raw = Utils.ToByteArray(
                "54018d8128058cf53788180457494343858c2004575553440457494343aed6c100a591e70046304402201ed06f47fa851fc663231f4874eb20bc2622933065280625d012690942391a1802207216210862d81e9b0098b1ec13615ab6bae97f08011f56430b7e2073deed0db8");

            var decodedTx = new Wicc.Tx.DexBuyLimitOrderTx();
            var serialize = new NBitcoin.Wicc.Commons.Serialize(raw);

            serialize.ReadWrite(decodedTx);

            var tx = new Wicc.Tx.DexBuyLimitOrderTx()
            {
                TxUid       = new RegId(228151, 1176),
                ValidHeight = 229672,
                Fees        = 100000,
                CoinSymbol  = new TokenSymbol("WUSD"),
                AssetSymbol = new TokenSymbol("WICC"),
                BidPrice    = 80000000,
                AssetAmount = 100000000,
            };

            Assert.IsTrue(decodedTx.ValidHeight == tx.ValidHeight);
            Assert.IsTrue(decodedTx.Version == tx.Version);
            Assert.IsTrue(decodedTx.TxType == tx.TxType);
            Assert.IsTrue(decodedTx.TxUid == tx.TxUid);
            Assert.IsTrue(decodedTx.Fees == tx.Fees);
            Assert.IsTrue(decodedTx.CoinSymbol == tx.CoinSymbol);
            Assert.IsTrue(decodedTx.AssetSymbol == tx.AssetSymbol);
            Assert.IsTrue(decodedTx.BidPrice == tx.BidPrice);
            Assert.IsTrue(decodedTx.AssetAmount == tx.AssetAmount);
            Assert.IsTrue(decodedTx.Signature.ToString() ==
                          "304402201ed06f47fa851fc663231f4874eb20bc2622933065280625d012690942391a1802207216210862d81e9b0098b1ec13615ab6bae97f08011f56430b7e2073deed0db8");
        }
Example #4
0
        public void DecodeTest()
        {
            var raw = Utils.ToByteArray(
                "56018d8128058cf53788180457494343858c2004575553440457494343aed6c10046304402204447376760e04403e32b77227f4ac4e30bd554fc8731e6057ee20874547e276a02207b0f41ff086493a18c32c20d5b03495ce59fcd3dd34844a4dabd80214a63705d");

            var decodedTx = new Wicc.Tx.DexBuyMarketOrderTx();
            var serialize = new NBitcoin.Wicc.Commons.Serialize(raw);

            serialize.ReadWrite(decodedTx);

            var tx = new Wicc.Tx.DexBuyMarketOrderTx()
            {
                TxUid       = new RegId(228151, 1176),
                ValidHeight = 229672,
                Fees        = 100000,
                CoinSymbol  = new TokenSymbol("WUSD"),
                AssetSymbol = new TokenSymbol("WICC"),
                AssetAmount = 100000000,
            };

            Assert.IsTrue(decodedTx.ValidHeight == tx.ValidHeight);
            Assert.IsTrue(decodedTx.Version == tx.Version);
            Assert.IsTrue(decodedTx.TxType == tx.TxType);
            Assert.IsTrue(decodedTx.TxUid == tx.TxUid);
            Assert.IsTrue(decodedTx.Fees == tx.Fees);
            Assert.IsTrue(decodedTx.CoinSymbol == tx.CoinSymbol);
            Assert.IsTrue(decodedTx.AssetSymbol == tx.AssetSymbol);
            Assert.IsTrue(decodedTx.AssetAmount == tx.AssetAmount);
            Assert.IsTrue(decodedTx.Signature.ToString() == "304402204447376760e04403e32b77227f4ac4e30bd554fc8731e6057ee20874547e276a02207b0f41ff086493a18c32c20d5b03495ce59fcd3dd34844a4dabd80214a63705d");
        }
Example #5
0
        public void DecodeTest()
        {
            var raw = Utils.ToByteArray(
                "0201856f2102c63be823c457d5262db92d50592cbeff32d7020ecaf6e35283b3cfd7e99fc4e40083e1ac0046304402202bd77c4863239144b89a8fc40bb2ef7ec0fd5a075b4f34ee6e7f980193be87f902204d8edfe03fa925eedc6e193304a953178cb4ba62e875860038486fb857db9f1a");

            var decodedTx = new Wicc.Tx.AccountRegTx();
            var serialize = new NBitcoin.Wicc.Commons.Serialize(raw);

            serialize.ReadWrite(decodedTx);

            var tx = new Wicc.Tx.AccountRegTx()
            {
                TxUid       = new PubKeyId(Utils.ToByteArray("02c63be823c457d5262db92d50592cbeff32d7020ecaf6e35283b3cfd7e99fc4e4")),
                Fees        = 10000000,
                ValidHeight = 879,
                Version     = 1,
                Signature   = new UnsignedCharArray(Utils.ToByteArray("304402202bd77c4863239144b89a8fc40bb2ef7ec0fd5a075b4f34ee6e7f980193be87f902204d8edfe03fa925eedc6e193304a953178cb4ba62e875860038486fb857db9f1a"))
            };

            Assert.IsTrue(decodedTx.Fees == tx.Fees);
            Assert.IsTrue(decodedTx.ValidHeight == tx.ValidHeight);
            Assert.IsTrue(decodedTx.Version == tx.Version);
            Assert.IsTrue(decodedTx.Signature == tx.Signature);
            Assert.IsTrue(decodedTx.TxType == tx.TxType);
            Assert.IsTrue((PubKeyId)decodedTx.TxUid == (PubKeyId)tx.TxUid);
        }