public async Task TestSubmitActionWorksForGetValidatorInfo() { var getValidatorInfoRequest = await Ledger.BuildGetValidatorInfoRequestAsync(did); getValidatorInfoRequest = await Ledger.SignRequestAsync(wallet, did, getValidatorInfoRequest); await Ledger.SubmitActionAsync(pool, getValidatorInfoRequest, null, -1); }
public async Task TestBuildGetValidatorInfoRequestWorks() { var expectedResult = "" + "\"operation\":{" + "\"type\":\"119\"" + "}"; var getValidatorInfoRequest = await Ledger.BuildGetValidatorInfoRequestAsync(DID); Assert.IsTrue(getValidatorInfoRequest.Replace("\\", "").Contains(expectedResult)); }
public async Task TestSubmitActionWorksForNodes() { var nodes = "[\"Node1\",\"Node2\"]"; var getValidatorInfoRequest = await Ledger.BuildGetValidatorInfoRequestAsync(did); getValidatorInfoRequest = await Ledger.SignRequestAsync(wallet, did, getValidatorInfoRequest); var responseJson = await Ledger.SubmitActionAsync(pool, getValidatorInfoRequest, nodes, -1); var response = JObject.Parse(responseJson); Assert.AreEqual(2, response.Count); Assert.IsNotNull(response["Node1"]); Assert.IsNotNull(response["Node2"]); }
public async Task TestGetValidatorInfoRequestWorks() { var didJson = JsonConvert.SerializeObject(new { seed = TRUSTEE_SEED }); var result = await Did.CreateAndStoreMyDidAsync(wallet, didJson); var did = result.Did; var getValidatorInfoRequest = await Ledger.BuildGetValidatorInfoRequestAsync(did); var getValidatorInfoResponse = await Ledger.SignAndSubmitRequestAsync(pool, wallet, did, getValidatorInfoRequest); var getValidatorInfoObj = JObject.Parse(getValidatorInfoResponse); for (int i = 1; i <= 4; i++) { var nodeName = string.Format("Node{0}", i); var nodeObject = JObject.Parse(getValidatorInfoObj[nodeName].ToString()); Assert.IsFalse(nodeObject["result"]["data"] == null); } }