This GitHub repository contains the smart contract implementation of the Drex Central Bank Digital Currency (CBDC) using Solidity. The contract provides functionalities for managing the digital currency, including minting, transferring, burning, freezing, and checking balances.
Other
49
stars
15
forks
source link
Feat: Address Discovery Contract Integration Test Suite #9
This PR introduces a new test suite for the AddressDiscovery smart contract. The tests ensure the contract's behavior aligns with its intended functionality.
Key changes:
The AddressDiscovery test suite has been created, covering key interactions and permissions.
Introduced hardhat and chai for contract deployment, interaction, and assertions.
describe("AddressDiscovery", function () {
it("should allow an account with ACCESS_ROLE to update address", async function () {...});
it("should not allow an account without ACCESS_ROLE to update address", async function () {...});
it("admin can change authority", async function () {...});
it("non-admin can't change authority", async function () {...});
});
Changes
Test Setup: Created a fixture for test setup using loadFixture function from hardhat-network-helpers. The fixture deploys the AddressDiscovery contract and also sets up some accounts for testing.
Role Testing: Wrote tests to ensure that the ACCESS_ROLE is respected when updating addresses in the contract.
Authority Change Testing: Wrote tests to ensure that only an admin can change the authority of the contract.
Helper Methods: Used ethers.js utilities for encoding and hashing data.
Please review these changes and let me know if any further adjustments are needed.
This PR introduces a new test suite for the
AddressDiscovery
smart contract. The tests ensure the contract's behavior aligns with its intended functionality.Key changes:
AddressDiscovery
test suite has been created, covering key interactions and permissions.hardhat
andchai
for contract deployment, interaction, and assertions.Changes
Test Setup: Created a fixture for test setup using
loadFixture
function fromhardhat-network-helpers
. The fixture deploys theAddressDiscovery
contract and also sets up some accounts for testing.Role Testing: Wrote tests to ensure that the ACCESS_ROLE is respected when updating addresses in the contract.
Authority Change Testing: Wrote tests to ensure that only an admin can change the authority of the contract.
Helper Methods: Used
ethers.js
utilities for encoding and hashing data.Please review these changes and let me know if any further adjustments are needed.