Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
🐛 Use certificateThreshold from state instead of params - Closes #8316
Browse files Browse the repository at this point in the history
  • Loading branch information
ishantiw committed Mar 29, 2023
1 parent 9eb646c commit 766cc30
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ export abstract class BaseInteroperabilityInternalMethod extends BaseInternalMet

const verifySignature = verifyAggregateCertificateSignature(
chainValidators.activeValidators,
params.certificateThreshold,
chainValidators.certificateThreshold,
params.sendingChainID,
certificate,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1146,14 +1146,16 @@ describe('Base interoperability internal method', () => {
},
};

const chainValidators = {
activeValidators,
certificateThreshold: BigInt(20),
};

beforeEach(async () => {
jest.spyOn(interopMod.events.get(InvalidCertificateSignatureEvent), 'add');
await interopMod.stores
.get(ChainValidatorsStore)
.set(methodContext, txParams.sendingChainID, {
activeValidators,
certificateThreshold: BigInt(20),
});
.set(methodContext, txParams.sendingChainID, chainValidators);
});

it('should reject if verifyWeightedAggSig fails', async () => {
Expand All @@ -1171,7 +1173,7 @@ describe('Base interoperability internal method', () => {
txParams.sendingChainID,
encodedUnsignedCertificate,
activeValidators.map(v => v.bftWeight),
txParams.certificateThreshold,
chainValidators.certificateThreshold,
);

expect(interopMod.events.get(InvalidCertificateSignatureEvent).add).toHaveBeenCalledTimes(1);
Expand Down

0 comments on commit 766cc30

Please sign in to comment.