-
Notifications
You must be signed in to change notification settings - Fork 0
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: getAllCIDs index out of bound issue #3
Conversation
contracts/mocks/DealStatusMock.sol
Outdated
@@ -96,11 +100,21 @@ contract DealStatusMock is IAggregatorOracle, ProofMock { | |||
// get the deal's expiration epoch | |||
MarketTypes.GetDealTermReturn memory dealTerm = MarketAPI.getDealTerm(dealId); | |||
|
|||
if (block.number < uint64(dealTerm.end) - epochs || block.number > uint64(dealTerm.end)) { | |||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting
contracts/mocks/DealStatusMock.sol
Outdated
@@ -74,7 +74,8 @@ contract DealStatusMock is IAggregatorOracle, ProofMock { | |||
for (uint256 i = 0; i < activeDealIds.length; i++) { | |||
uint64 dealID = activeDealIds[i].dealId; | |||
// get the deal's expiration epoch | |||
MarketTypes.GetDealActivationReturn memory dealActivationStatus = MarketAPI.getDealActivation(dealID); | |||
MarketTypes.GetDealActivationReturn memory dealActivationStatus = MarketAPI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting
contracts/mocks/DealStatusMock.sol
Outdated
@@ -85,7 +86,10 @@ contract DealStatusMock is IAggregatorOracle, ProofMock { | |||
} | |||
|
|||
// getExpiringDeals should return all the deals' dealIds if they are expiring within `epochs` | |||
function getExpiringDeals(bytes memory _cid, uint64 epochs) external view returns (Deal[] memory) { | |||
function getExpiringDeals( | |||
bytes memory _cid, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting
tests/DealStatus.js
Outdated
expect(activeDeals.toString()).to.be.equal("1234,4321,2222,4321"); | ||
}); | ||
await expect(this.dealstatus.complete(1, 2222, 4321, incProof, verifData)) | ||
.to.emit(this.dealstatus, "CompleteAggregatorRequest") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting
tests/DealStatus.js
Outdated
const allDeals = await this.dealstatus.getAllDeals("0x0181e2039220203f46bc645b07a3ea2c04f066f939ddf7e269dd77671f9e1e61a3a3797e665127"); | ||
it("Should return all the deals' dealIds if they are expiring within a certain input epoch", async function () { | ||
const expiringDeals = await this.dealstatus.callStatic.getExpiringDeals( | ||
"0x0181e2039220203f46bc645b07a3ea2c04f066f939ddf7e269dd77671f9e1e61a3a3797e665127", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.