Beispiel #1
0
        public void Setup()
        {
            if (File.Exists(sampleStoreFile))
            {
                // For testing start fresh
                File.Delete(sampleStoreFile);
            }

            sampleStore = new SampleStore(sampleStoreFile);

            // SampleUser can be any implementation that implements org.hyperledger.fabric.sdk.User Interface
            admin = sampleStore.GetMember(TEST_ADMIN_NAME, TEST_ADMIN_ORG);
        }
Beispiel #2
0
        public void Setup()
        {
            string sampleStoreFile = Path.Combine(Path.GetTempPath(), "HFCSampletest.properties");

            if (File.Exists(sampleStoreFile))
            {
                // For testing start fresh
                File.Delete(sampleStoreFile);
            }

            sampleStore = new SampleStore(sampleStoreFile);

            // SampleUser can be any implementation that implements org.hyperledger.fabric.sdk.User Interface
            admin = sampleStore.GetMember(TEST_ADMIN_NAME, TEST_ADMIN_ORG);
        }
        public static void SetupClient(HFClient hfclient)
        {
            ICryptoSuite cryptoSuite = Factory.GetCryptoSuite();

            string props = Path.Combine(GetHomePath(), "test.properties");

            if (File.Exists(props))
            {
                File.Delete(props);
            }
            SampleStore sampleStore = new SampleStore(props);

            //src/test/fixture/sdkintegration/e2e-2Orgs/channel/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/

            //SampleUser someTestUSER = sampleStore.getMember("someTestUSER", "someTestORG");
            SampleUser someTestUSER = sampleStore.GetMember("someTestUSER", "someTestORG", "mspid", FindFileSk("fixture/sdkintegration/e2e-2Orgs/" + TestConfig.Instance.FAB_CONFIG_GEN_VERS + "/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore"), ("fixture/sdkintegration/e2e-2Orgs/" + TestConfig.Instance.FAB_CONFIG_GEN_VERS + "/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected]").Locate());

            someTestUSER.MspId = "testMSPID?";

            hfclient.CryptoSuite = Factory.Instance.GetCryptoSuite();
            hfclient.UserContext = someTestUSER;
        }