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

feat: update maximum NCG Transfer limit Phase #2 #272

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions bridge/test/observers/nine-chronicles.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe(NCGTransferredEventObserver.name, () => {
};

const exchangeFeeRatioPolicy = new FixedExchangeFeeRatioPolicy(
new Decimal(20000),
new Decimal(50000),
new Decimal(10000),
{
criterion: new Decimal(1000),
Expand All @@ -102,7 +102,7 @@ describe(NCGTransferredEventObserver.name, () => {
};

const limitationPolicy = {
maximum: 20000,
maximum: 50000,
whitelistMaximum: 200000,
minimum: 100,
};
Expand Down Expand Up @@ -622,7 +622,7 @@ describe(NCGTransferredEventObserver.name, () => {
});

expect(mockExchangeHistoryStore.put).toHaveBeenNthCalledWith(8, {
amount: 2500, // 20000 - ( 500 + 5000 + 12000 )
amount: 32500, // 50000 - ( 500 + 5000 + 12000 )
network: "nineChronicles",
recipient: wrappedNcgRecipient,
sender: sender,
Expand Down Expand Up @@ -690,7 +690,8 @@ describe(NCGTransferredEventObserver.name, () => {
[wrappedNcgRecipient, new Decimal(4950000000000000000000)], // Fee First Range ( 5000 NCG, Fee 0.01 )
// Fee Second Range ( 12000 NCG, Fee ( 0.01 for 12000 + 0.02 for 2000 )
[wrappedNcgRecipient, new Decimal(11840000000000000000000)],
[wrappedNcgRecipient, new Decimal(2475000000000000000000)],
// Fee Second Range ( left 32500 NCG, Fee ( 0.01 for 32500 + 0.02 for 22500 ) = 775 NCG
[wrappedNcgRecipient, new Decimal(31725000000000000000000)],
[allowlistRecipient, new Decimal(10870000000000000000000)],
[feeWaiverRecipient, new Decimal(11000000000000000000000)],
]);
Expand Down
6 changes: 5 additions & 1 deletion bridge/test/policies/exchange-fee-ratio.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { FixedExchangeFeeRatioPolicy } from "../../src/policies/exchange-fee-rat

describe(FixedExchangeFeeRatioPolicy.name, () => {
const policy = new FixedExchangeFeeRatioPolicy(
new Decimal(20000),
new Decimal(50000),
new Decimal(10000),
{
criterion: new Decimal(1000),
Expand Down Expand Up @@ -33,6 +33,10 @@ describe(FixedExchangeFeeRatioPolicy.name, () => {
expect(policy.getFee(new Decimal(12000))).toEqual(new Decimal(160));
expect(policy.getFee(new Decimal(15000))).toEqual(new Decimal(250));
expect(policy.getFee(new Decimal(20000))).toEqual(new Decimal(400));
expect(policy.getFee(new Decimal(32500))).toEqual(new Decimal(775));
expect(policy.getFee(new Decimal(50000))).toEqual(
new Decimal(1300)
);
});
});
});
Loading