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

Increase total active cover amount when migrating covers #814

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions contracts/interfaces/IBrightUnionDistributor.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity >=0.5.0;

interface IBrightUnionDistributor {

function submitClaim(uint tokenId, bytes calldata) external;

function ownerOf(uint tokenId) external view returns (address);
}
4 changes: 4 additions & 0 deletions contracts/modules/cover/Cover.sol
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,10 @@ contract Cover is ICover, MasterAwareV2, IStakingPoolBeacon, ReentrancyGuard {
coverId = coverNFT.mint(newOwner);
_coverData[coverId] = CoverData(productId.toUint24(), coverAsset.toUint8(), 0 /* amountPaidOut */);

uint bucketAtExpiry = Math.divCeil((start + period), BUCKET_SIZE);
activeCoverExpirationBuckets[coverAsset][bucketAtExpiry] += amount;
activeCover[coverAsset].totalActiveCoverInAsset += amount.toUint192();
roxdanila marked this conversation as resolved.
Show resolved Hide resolved

_coverSegments[coverId].push(
CoverSegment(
amount.toUint96(),
Expand Down
2 changes: 1 addition & 1 deletion test/fork/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
describe('fork tests', function () {
require('./product-type-update');
require('./migrated-claims');
});