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: getAllCIDs index out of bound issue #3

Merged
merged 6 commits into from
Oct 12, 2023
Merged

Fix: getAllCIDs index out of bound issue #3

merged 6 commits into from
Oct 12, 2023

Conversation

parva-jain
Copy link
Collaborator

No description provided.

@@ -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 (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting

@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting

@@ -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,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting

@ravish1729 ravish1729 changed the title Staging Fix: getAllDeals index out of bound issue Oct 12, 2023
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")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting

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",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting

@parva-jain parva-jain changed the title Fix: getAllDeals index out of bound issue Fix: getAllCIDs index out of bound issue Oct 12, 2023
Copy link
Collaborator

@ravish1729 ravish1729 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ravish1729 ravish1729 merged commit d3247c3 into main Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants