Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test and typos #11

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions contracts/DappnodeSmoothingPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ contract DappnodeSmoothingPool is OwnableUpgradeable {

/**
* @notice Be able to receive ether donations and MEV rewards
* Oracle will be able to differenciate between MEV rewards and donations and distribute rewards accordingly
* Oracle will be able to differentiate between MEV rewards and donations and distribute rewards accordingly
**/
fallback() external payable {
emit EtherReceived(msg.sender, msg.value);
Expand Down Expand Up @@ -396,10 +396,10 @@ contract DappnodeSmoothingPool is OwnableUpgradeable {
lastVotedReportHash
];

// Substract a vote on the last voted report
// Subtract a vote on the last voted report
// That report could have 0 votes because:
// - The report was already consolidated
// - Were substracted all the votes from that report
// - Were subtracted all the votes from that report
if (lastVotedReport.votes > 0) {
unchecked {
lastVotedReport.votes--;
Expand Down Expand Up @@ -500,7 +500,7 @@ contract DappnodeSmoothingPool is OwnableUpgradeable {
lastVotedReportHash
];

// Substract a vote of this oracle member
// Subtract a vote of this oracle member
// If the votes == 0, that report was already consolidated
if (lastVotedReport.votes > 0) {
unchecked {
Expand Down
18 changes: 9 additions & 9 deletions test/DappnodeSmoothingPool.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ describe('DappnodeSmoothingPool test', () => {
})).to.emit(dappnodeSmoothingPool, 'EtherReceived').withArgs(donator.address, donationValue);
});

it('Should suscribe validator and unsubscribe', async () => {
it('Should subscribe validator and unsubscribe', async () => {
const validatorID = 1;

// Check subscribeValidator
Expand All @@ -149,7 +149,7 @@ describe('DappnodeSmoothingPool test', () => {
.withArgs(deployer.address, validatorID);
});

it('Should suscribe multiple validators', async () => {
it('Should subscribe multiple validators', async () => {
const validatorID = 1;
const validatorID2 = 10;
const validatorID3 = 12;
Expand Down Expand Up @@ -317,7 +317,7 @@ describe('DappnodeSmoothingPool test', () => {
.to.be.revertedWith('Ownable: caller is not the owner');

await expect(dappnodeSmoothingPool.connect(deployer).updatePoolFee(10001))
.to.be.revertedWith('Pool fee cannot be greater than 100%');
.to.be.revertedWith('DappnodeSmoothingPool::updatePoolFee: Pool fee cannot be greater than 100%');

await expect(dappnodeSmoothingPool.connect(deployer).updatePoolFee(newPoolFee))
.to.emit(dappnodeSmoothingPool, 'UpdatePoolFee')
Expand Down Expand Up @@ -366,7 +366,7 @@ describe('DappnodeSmoothingPool test', () => {
await expect(dappnodeSmoothingPool.connect(governance).submitReport(slotNumber, rewardsMerkleTree.getHexRoot()))
.to.be.revertedWith('DappnodeSmoothingPool::submitReport: Smoothing pool not initialized');

// Initialize smoorhing pool
// Initialize smoothing pool
await expect(dappnodeSmoothingPool.connect(deployer).initSmoothingPool(checkpointSlotSize))
.to.emit(dappnodeSmoothingPool, 'InitSmoothingPool')
.withArgs(checkpointSlotSize);
Expand Down Expand Up @@ -399,7 +399,7 @@ describe('DappnodeSmoothingPool test', () => {

const slotNumber = checkpointSlotSize * 2;

// Initialize smoorhing pool
// Initialize smoothing pool
await expect(dappnodeSmoothingPool.connect(deployer).initSmoothingPool(checkpointSlotSize))
.to.emit(dappnodeSmoothingPool, 'InitSmoothingPool')
.withArgs(checkpointSlotSize);
Expand Down Expand Up @@ -508,7 +508,7 @@ describe('DappnodeSmoothingPool test', () => {

const slotNumber = checkpointSlotSize * 2;

// Initialize smoorhing pool
// Initialize smoothing pool
await expect(dappnodeSmoothingPool.connect(deployer).initSmoothingPool(checkpointSlotSize))
.to.emit(dappnodeSmoothingPool, 'InitSmoothingPool')
.withArgs(checkpointSlotSize);
Expand Down Expand Up @@ -593,7 +593,7 @@ describe('DappnodeSmoothingPool test', () => {
expect(await dappnodeSmoothingPool.addressToVotedReportHash(oracleMember1.address))
.to.be.equal(newVotedReportHash);

// Didint change since it onyl vote once and consolidates the state
// Didn't change since it only vote once and consolidates the state
expect(await dappnodeSmoothingPool.addressToVotedReportHash(oracleMember2.address))
.to.be.equal(await dappnodeSmoothingPool.INITIAL_REPORT_HASH());

Expand Down Expand Up @@ -623,7 +623,7 @@ describe('DappnodeSmoothingPool test', () => {

const slotNumber = checkpointSlotSize * 2;

// Initialize smoorhing pool
// Initialize smoothing pool
await expect(dappnodeSmoothingPool.connect(deployer).initSmoothingPool(checkpointSlotSize))
.to.emit(dappnodeSmoothingPool, 'InitSmoothingPool')
.withArgs(checkpointSlotSize);
Expand Down Expand Up @@ -712,7 +712,7 @@ describe('DappnodeSmoothingPool test', () => {
// Update rewards root
const slotNumber = checkpointSlotSize * 2;

// Initialize smoorhing pool
// Initialize smoothing pool
await expect(dappnodeSmoothingPool.connect(deployer).initSmoothingPool(checkpointSlotSize))
.to.emit(dappnodeSmoothingPool, 'InitSmoothingPool')
.withArgs(checkpointSlotSize);
Expand Down