public void TestTreeHasOnlyOneLeafShouldSetLeafAsRootNode()
        {
            var factory = new CurlMerkleTreeFactory(new CurlMerkleNodeFactory(new Curl()), new CurlMerkleLeafFactory(new AddressGeneratorStub()), new Curl(CurlMode.CurlP27));
            var tree    = factory.Create(Seed.Random(), 0, 1, SecurityLevel.Medium);

            Assert.IsNotNull(tree.Root);
        }
Esempio n. 2
0
        public MamService(IIotaRepository repository, IMask mask, Seed seed)
        {
            var curl        = new Curl();
            var treeFactory = new CurlMerkleTreeFactory(new CurlMerkleNodeFactory(curl), new CurlMerkleLeafFactory(new AddressGenerator(seed, SecurityNumber)));
            var mamFactory  = new CurlMamFactory(curl, mask);
            var mamParser   = new CurlMamParser(mask, treeFactory, curl);

            this.ChannelFactory      = new MamChannelFactory(mamFactory, treeFactory, repository);
            this.SubscriptionFactory = new MamChannelSubscriptionFactory(repository, mamParser);
        }