Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
add tests and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ncitron committed Aug 3, 2022
1 parent 8f1a1e6 commit 505af18
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/HuffDeployer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ library HuffDeployer {
return config().deploy(fileName);
}

function broadcast(string memory filename) internal returns (address) {
return config().set_broadcast(true).deploy(filename);
/// @notice Compiles a Huff contract and returns the address that the contract was deployeod to
/// @param fileName - The file name of the Huff contract. For example, the file name for "SimpleStore.huff" is "SimpleStore"
/// @return The address that the contract was deployed to
function broadcast(string memory fileName) internal returns (address) {
return config().set_broadcast(true).deploy(fileName);
}

/// @notice Compiles a Huff contract and returns the address that the contract was deployeod to
Expand Down
6 changes: 6 additions & 0 deletions src/test/HuffConfig.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,10 @@ contract HuffConfigTest is Test {
assertEq(key, k);
assertEq(value, v);
}

function testSetBroadcast(bool broadcast) public {
config.set_broadcast(broadcast);
bool b = config.should_broadcast();
assertEq(b, broadcast);
}
}

0 comments on commit 505af18

Please sign in to comment.