Esempio n. 1
0
        public void SignRequestNymRequestSuccessfully()
        {
            INymLedger ledger = IndyDotNet.Ledger.Factory.CreateNymLedger();

            IDid submitter = IndyDotNet.Did.Factory.CreateMyDid(_pool, _wallet, new IdentitySeed()
            {
                Seed = "000000000000000000000000Trustee1"
            });

            IDid target = IndyDotNet.Did.Factory.CreateMyDid(_pool, _wallet, new IdentitySeed()
            {
                Seed = "000000000000000000000000Trustee2"
            });

            BuildRequestResult result     = ledger.BuildRequest(submitter, target, null, null, NymRoles.NA);
            BuildRequestResult signResult = ledger.SignRequest(_wallet, submitter, result);

            Assert.IsNotNull(signResult, "failed to create SignAndSubmitRequestResult");

            // Dids are submitter: V4SGRU86Z58d6TV7PBUe6f and target: LnXR1rPnncTPZvRdmJKhJQ
            Assert.IsNotNull(signResult, "failed to create BuildNymRequestResult");
            Assert.IsTrue(0 < signResult.ReqId, "ReqId not set");
            Assert.AreEqual(signResult.Identifier, submitter.Did, $"Identifer failed match to submitter: {submitter.Did}");
            Assert.AreEqual(signResult.Operation.Dest, target.Did, $"Dest failed match to target: {target.Did}");
            Assert.IsFalse(string.IsNullOrEmpty(signResult.Signature), $"Signature not found: '{signResult.Signature}'");
        }
Esempio n. 2
0
        public void SubmitRequestNymRequestSuccessfully()
        {
            INymLedger ledger = IndyDotNet.Ledger.Factory.CreateNymLedger();

            IDid submitter = IndyDotNet.Did.Factory.CreateMyDid(_pool, _wallet, new IdentitySeed()
            {
                Seed = "000000000000000000000000Trustee1"
            });

            IDid target = IndyDotNet.Did.Factory.CreateMyDid(_pool, _wallet, new IdentitySeed()
            {
                Seed = "000000000000000000000000Trustee2"
            });

            BuildRequestResult           result       = ledger.BuildRequest(submitter, target, null, null, NymRoles.NA);
            BuildRequestResult           signedResult = ledger.SignRequest(_wallet, submitter, result);
            SignAndSubmitRequestResponse signResult   = ledger.SubmitRequest(_pool, signedResult);

            Assert.IsNotNull(signResult, "failed to create SignAndSubmitRequestResult");

            // Dids are submitter: V4SGRU86Z58d6TV7PBUe6f and target: LnXR1rPnncTPZvRdmJKhJQ
            Assert.AreEqual(signResult.Result.Transaction.Metadata.From, submitter.Did, $"txn.metadata.from failed to match submitter: {submitter.Did}");
            Assert.AreEqual(signResult.Result.Transaction.TxnData.Dest, target.Did, $"txn.data.dest failed to match target: {target.Did}");
        }