Skip to content

Commit

Permalink
refactor: renamed variables, fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
0xKoaj committed Sep 4, 2023
1 parent e7ca444 commit 84e6df7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ interface IDIAOracleV2 {
contract DIAChainlinkAdapter is AggregatorV2V3Interface {
/// @notice Thrown when trying to query a round that is not the latest one
error OnlyLatestRoundIsAvailable();
error NotImplemented();

/// @notice The address of the underlying DIA Oracle
address public immutable DIA_ORACLE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ contract DIAChainlinkAdapterFactory {

function createAdapter(
address _diaOracle,
uint8 _diaOracledecimals,
uint8 _decimals,
uint8 _oracledecimals,
uint8 _feedDecimals,
string calldata _description
) external returns (DIAChainlinkAdapter _adapter) {
_adapter = new DIAChainlinkAdapter{salt: bytes32(0)}(_diaOracle, _diaOracledecimals, _decimals, _description);
_adapter = new DIAChainlinkAdapter{salt: bytes32(0)}(_diaOracle, _oracledecimals, _feedDecimals, _description);
emit AdapterCreated(_adapter);
}

function computeAdapterAddress(
address _diaOracle,
uint8 _diaOracledecimals,
uint8 _decimals,
uint8 _oracleDecimals,
uint8 _feedDecimals,
string calldata _description
) external view returns (address _adapter) {
return
Expand All @@ -30,7 +30,7 @@ contract DIAChainlinkAdapterFactory {
// Deployment bytecode:
type(DIAChainlinkAdapter).creationCode,
// Constructor arguments:
abi.encode(_diaOracle, _diaOracledecimals, _decimals, _description)
abi.encode(_diaOracle, _oracleDecimals, _feedDecimals, _description)
)
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,8 @@ describe('DIAChainlinkAdapter', () => {

describe('version', () => {
when('called', () => {
then('value should revert', async () => {
then('reverts with message', async () => {
await behaviours.txShouldRevertWithMessage({
contract: adapter,
func: 'version',
args: [1],
message: 'NotImplemented',
});
});
then('value is returned correctly', async () => {
expect(await adapter.version()).to.equal(4);
});
});
});
Expand Down

0 comments on commit 84e6df7

Please sign in to comment.