Beispiel #1
0
        protected StoredSettings CreateProofAndSettingsChain()
        {
            var settings = new ChainSettings(Version: ChainSettings.VersionEnum.NUMBER_1, Secret: Encoding.UTF8.GetBytes("very secret"))
            {
                HashAlgorithm = ChainSettings.HashAlgorithmEnum._256,
                ContentRegistrationChainTypes = new List <ChainSettings.ContentRegistrationChainTypesEnum>
                {
                    ChainSettings.ContentRegistrationChainTypesEnum.PERHASHPROOFCHAIN,
                    ChainSettings.ContentRegistrationChainTypesEnum.SINGLEPROOFCHAIN
                }
            };

            var createConfiguration = new CreateConfigurationRequest(Name: ExampleConfigName,
                                                                     InitialSettings: settings,
                                                                     Context: TestContextMultichain, AccessMode: CreateConfigurationRequest.AccessModeEnum.PRIVATE);

            var configurationResponse = _configurationApi.CreateConfiguration(createConfiguration);
            var storedSettings        = configurationResponse.StoredSettings;

            Assert.NotNull(storedSettings);
            Assert.NotNull(storedSettings.Context);
            Assert.NotNull(storedSettings.ChainSettings);
            Assert.NotNull(storedSettings.SingleProofChain);
            Assert.NotNull(storedSettings.SettingsChain);
            Assert.NotNull(storedSettings.ChainConfiguration);
            Assert.NotNull(storedSettings.ChainSettings.SingleProofChain);
            Assert.NotNull(storedSettings.ChainSettings.HashAlgorithm);
            SettingsChainId = storedSettings.SettingsChain.ChainId;
            ProofChainId    = storedSettings.SingleProofChain.ChainId;
            return(storedSettings);
        }