Skip to content

Commit

Permalink
Run formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ognjenkurtic committed Jul 24, 2024
1 parent ebba9b6 commit 6ccbceb
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions examples/bri-3/test/sriUseCase.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,15 +283,17 @@ describe('SRI use-case end-to-end test', () => {
const resultWorkstepInstanceId = resultTransaction.workstepInstanceId;

const contract = getContractFromLocalNode();
const contentAddressableHash = await contract.getAnchorHash(resultWorkstepInstanceId);
const contentAddressableHash = await contract.getAnchorHash(
resultWorkstepInstanceId,
);

expect(contentAddressableHash).toBeTruthy();
expect(contentAddressableHash.length).toBeGreaterThan(0);

expect(stateBpiMerkleTree.getLeaf(0)).toEqual(contentAddressableHash);

const stateTreeLeafValue = await fetchStateTreeLeafViaCAH(
contentAddressableHash
contentAddressableHash,
);

expect(stateTreeLeafValue).toBeTruthy();
Expand Down Expand Up @@ -354,15 +356,17 @@ describe('SRI use-case end-to-end test', () => {
const resultWorkstepInstanceId = resultTransaction.workstepInstanceId;

const contract = getContractFromLocalNode();
const contentAddressableHash = await contract.getAnchorHash(resultWorkstepInstanceId);
const contentAddressableHash = await contract.getAnchorHash(
resultWorkstepInstanceId,
);

expect(contentAddressableHash).toBeTruthy();
expect(contentAddressableHash.length).toBeGreaterThan(0);

expect(stateBpiMerkleTree.getLeaf(1)).toEqual(contentAddressableHash);

const stateTreeLeafValue = await fetchStateTreeLeafViaCAH(
contentAddressableHash
contentAddressableHash,
);

expect(stateTreeLeafValue).toBeTruthy();
Expand Down Expand Up @@ -425,15 +429,17 @@ describe('SRI use-case end-to-end test', () => {
const resultWorkstepInstanceId = resultTransaction.workstepInstanceId;

const contract = getContractFromLocalNode();
const contentAddressableHash = await contract.getAnchorHash(resultWorkstepInstanceId);
const contentAddressableHash = await contract.getAnchorHash(
resultWorkstepInstanceId,
);

expect(contentAddressableHash).toBeTruthy();
expect(contentAddressableHash.length).toBeGreaterThan(0);

expect(stateBpiMerkleTree.getLeaf(2)).toEqual(contentAddressableHash);

const stateTreeLeafValue = await fetchStateTreeLeafViaCAH(
contentAddressableHash
contentAddressableHash,
);

expect(stateTreeLeafValue).toBeTruthy();
Expand Down Expand Up @@ -656,12 +662,13 @@ async function fetchTransaction(txId: string): Promise<any> {
}

function getContractFromLocalNode(): ethers.Contract {
const provider = new JsonRpcProvider('http://localhost:8545');
const contractAddress = '0x1CC96ba639d4fd7624913fde39122270a1aC5c34';
const provider = new JsonRpcProvider('http://127.0.0.1:8545');
const contractAddress = `${process.env.CCSM_BPI_STATE_ANCHOR_CONTRACT_ADDRESS}`;

const contractABI = [
'function getAnchorHash(string calldata _workstepInstanceId) external view returns (string memory)'
'function getAnchorHash(string calldata _workstepInstanceId) external view returns (string memory)',
];

return new ethers.Contract(contractAddress, contractABI, provider);
}

Expand Down

0 comments on commit 6ccbceb

Please sign in to comment.