Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions test/onchain-identity/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@ describe('Next tests reproduce identity life cycle', function () {
});

it('Root of roots and claims root should be updated', async function () {
const afterTranstionLatestSavedState = await identity.getLatestPublishedState();
const afterTransitionLatestSavedState = await identity.getLatestPublishedState();
const afterTransitionRootOfRootsTreeRoot = await identity.getLatestPublishedRootsRoot();

expect(afterTransitionRootOfRootsTreeRoot).to.be.not.equal(0);
expect(afterTransitionRootOfRootsTreeRoot).to.be.not.equal(
beforeTransitionRootOfRootsTreeRoot
);
expect(latestSavedState).to.be.not.equal(afterTranstionLatestSavedState);
latestSavedState = afterTranstionLatestSavedState;
expect(latestSavedState).to.be.not.equal(afterTransitionLatestSavedState);
latestSavedState = afterTransitionLatestSavedState;
});
it('calculatet and saved status should be same', async function () {
latestComputedState = await identity.calcIdentityState();
Expand Down Expand Up @@ -350,7 +350,7 @@ describe('Root of roots tree proofs', () => {
identity = contracts.identity;
});

describe('Insert two claims and make transtion state', () => {
describe('Insert two claims and make transition state', () => {
before(async function () {
await identity.addClaimHash(1, 2);
await identity.addClaimHash(2, 2);
Expand Down Expand Up @@ -432,11 +432,11 @@ describe('Compare historical roots with latest roots from tree', () => {
expect(history.claimsRoot).to.be.deep.equal(latestClaimsTreeRoot);
});
it('Compare latest revocations tree root', async function () {
const latestReocationsTreeRoot = await identity.getRevocationsTreeRoot();
const latestRevocationsTreeRoot = await identity.getRevocationsTreeRoot();
const history = await identity.getRootsByState(latestState);

expect(latestReocationsTreeRoot).to.be.not.equal(0);
expect(history.revocationsRoot).to.be.deep.equal(latestReocationsTreeRoot);
expect(latestRevocationsTreeRoot).to.be.not.equal(0);
expect(history.revocationsRoot).to.be.deep.equal(latestRevocationsTreeRoot);
});
it('Compare latest roots tree root', async function () {
const latestRootOfRoots = await identity.getRootsTreeRoot();
Expand Down Expand Up @@ -481,12 +481,12 @@ describe('Compare historical roots with latest roots from tree', () => {
historyClaimsTreeRoot = latestClaimsTreeRoot;
});
it('Compare latest revocations tree root', async function () {
const latestReocationsTreeRoot = await identity.getRevocationsTreeRoot();
const latestRevocationsTreeRoot = await identity.getRevocationsTreeRoot();
const history = await identity.getRootsByState(prevState);

expect(latestReocationsTreeRoot).to.be.not.equal(0);
expect(history.revocationsRoot).to.be.deep.equal(latestReocationsTreeRoot);
historyRevocationsTreeRoot = latestReocationsTreeRoot;
expect(latestRevocationsTreeRoot).to.be.not.equal(0);
expect(history.revocationsRoot).to.be.deep.equal(latestRevocationsTreeRoot);
historyRevocationsTreeRoot = latestRevocationsTreeRoot;
});
it('Compare latest roots tree root', async function () {
const latestRootOfRoots = await identity.getRootsTreeRoot();
Expand All @@ -512,11 +512,11 @@ describe('Compare historical roots with latest roots from tree', () => {
expect(history.claimsRoot).to.be.deep.equal(historyClaimsTreeRoot);
});
it('Check historical revocations tree root', async function () {
const latestReocationsTreeRoot = await identity.getRevocationsTreeRoot();
const latestRevocationsTreeRoot = await identity.getRevocationsTreeRoot();
const history = await identity.getRootsByState(prevState);

expect(latestReocationsTreeRoot).to.be.not.equal(0);
expect(history.revocationsRoot).to.not.deep.equal(latestReocationsTreeRoot);
expect(latestRevocationsTreeRoot).to.be.not.equal(0);
expect(history.revocationsRoot).to.not.deep.equal(latestRevocationsTreeRoot);
expect(history.revocationsRoot).to.be.deep.equal(historyRevocationsTreeRoot);
});
it('Check historical roots tree root', async function () {
Expand All @@ -530,7 +530,7 @@ describe('Compare historical roots with latest roots from tree', () => {
});
});

describe("Genesis state doens't have history of states", () => {
describe("Genesis state doesn't have history of states", () => {
let identity;

before(async function () {
Expand Down