Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions contracts/Checkpointer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,12 @@ contract Checkpointer {
trusters[lowest] = msg.sender;
}
}
function getTrusted() public view returns (address[] memory) {
address[] memory ret = new address[](trusters.length);
for(uint i = 0; i < trusters.length; i++) {
ret[i] = trusted[trusters[i]];
}
return ret;
}
}

7 changes: 7 additions & 0 deletions test/Checkpointer.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ describe("Checkpointer contract", function() {
await Checkpointer.trust(deployer.address);
});

it("Get All trusters", async function() {
await Checkpointer.trust(deployer.address);

const t = await Checkpointer.getTrusted();
console.log(t);
});

it("Submit checkpoint and send to BridgeAuthority", async function() {
const submit_block = await ethers.provider.getBlock(latest_block_number - 100);
await Checkpointer.attest(submit_block.number, submit_block.hash);
Expand Down