Beispiel #1
0
        private Script AssertCompressed(Script script, int expectedSize)
        {
            var compressor = new ScriptCompressor(script);
            var compressed = compressor.ToBytes();
            Assert.Equal(expectedSize, compressed.Length);

            compressor = new ScriptCompressor();
            compressor.ReadWrite(compressed);
            AssertEx.CollectionEquals(compressor.GetScript().ToRawScript(), script.ToRawScript());

            var compressed2 = compressor.ToBytes();
            AssertEx.CollectionEquals(compressed, compressed2);
            return compressor.GetScript();
        }