Esempio n. 1
0
        public void FileScriptTest()
        {
            var f = BProtocol.ParseScript(NBitcoin.Script.FromHex(SampleScriptHex));

            Assert.NotNull(f);
            Assert.Equal(SampleFileBody, System.Text.Encoding.UTF8.GetString(f.Body));
            Assert.Equal(SampleFileMimeType, f.MimeType);
            Assert.Equal(SampleFileName, f.Name);
        }
Esempio n. 2
0
        public void ScriptTest()
        {
            var f = new BProtocol.FileScript
            {
                Body     = System.Text.Encoding.UTF8.GetBytes(SampleFileBody),
                MimeType = SampleFileMimeType,
                Name     = SampleFileName
            };

            Assert.Equal(SampleScriptHex, BProtocol.GetScript(f).ToHex());
        }