Пример #1
0
        public void SetToP2SH_P2WSH_ExceptionTest()
        {
            PubkeyScript scr = new PubkeyScript();

            Assert.Throws <ArgumentNullException>(() => scr.SetToP2SH_P2WSH(null));
            Assert.Throws <ArgumentException>(()
                                              => scr.SetToP2SH_P2WSH(new MockSerializableRedeemScript(RedeemScriptType.Empty, new byte[0], 1)));
        }
Пример #2
0
        public void SetToP2SH_P2WSH_Test()
        {
            PubkeyScript scr    = new PubkeyScript();
            var          redeem = new MockSerializableRedeemScript(RedeemScriptType.P2SH_P2WSH, new byte[] { 1, 2, 3 }, 10);

            scr.SetToP2SH_P2WSH(redeem);
            byte[] expected = Helper.HexToBytes($"a9149bc4860bb936abf262d7a51f74b4304833fee3b287");
            Assert.Equal(expected, scr.Data);
        }