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

Major update of PoS unit tests #9193

Merged
merged 6 commits into from
Jan 8, 2024
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
2 changes: 1 addition & 1 deletion framework/src/modules/pos/commands/stake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class StakeCommand extends BaseCommand {
return {
status: VerifyStatus.FAIL,
error: new ValidationError(
'Amount should be multiple of 10 * 10^8.',
`Amount should be multiple of ${this._baseStakeAmount}.`,
ishantiw marked this conversation as resolved.
Show resolved Hide resolved
stake.amount.toString(),
),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { PrefixedStateReadWriter } from '../../../../../src/state_machine/prefix
import { createFakeBlockHeader, InMemoryPrefixedStateDB } from '../../../../../src/testing';
import { createStoreGetter } from '../../../../../src/testing/utils';

describe('Change Commission command', () => {
describe('Claim Rewards command', () => {
const pos = new PoSModule();
const publicKey = utils.getRandomBytes(32);
const senderAddress = address.getAddressFromPublicKey(publicKey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
VALIDATOR_REGISTRATION_FEE,
} from '../../../../../src/modules/pos/constants';
import { ValidatorRegisteredEvent } from '../../../../../src/modules/pos/events/validator_registered';
import { liskToBeddows } from '../../../../utils/assets';

describe('Validator registration command', () => {
const pos = new Modules.PoS.PoSModule();
Expand All @@ -53,7 +54,6 @@ describe('Validator registration command', () => {
generatorKey: utils.getRandomBytes(32),
blsKey: utils.getRandomBytes(48),
proofOfPossession: utils.getRandomBytes(96),
validatorRegistrationFee: VALIDATOR_REGISTRATION_FEE,
};
const defaultValidatorInfo = {
name: transactionParams.name,
Expand All @@ -77,7 +77,7 @@ describe('Validator registration command', () => {
command: 'registerValidator',
senderPublicKey: publicKey,
nonce: BigInt(0),
fee: BigInt(1000000000),
fee: liskToBeddows(20),
params: encodedTransactionParams,
signatures: [publicKey],
});
Expand Down Expand Up @@ -206,7 +206,7 @@ describe('Validator registration command', () => {
command: 'registerValidator',
senderPublicKey: publicKey,
nonce: BigInt(0),
fee: BigInt(100000000),
fee: liskToBeddows(1),
params: invalidParams,
signatures: [publicKey],
});
Expand Down
Loading