a477b007e1
* Squashed clients/validator content from old branch * fix up tests fix up linting * add bundle script * add build prod script to package json update tests * update readme + copy to dist output update global types update types and tests! * update package build * move types and tests into src * Squashed clients/validator content from old branch fix up tests fix up linting * add bundle script * add build prod script to package json update tests * update readme + copy to dist output update global types update types and tests! update package build * move types and tests into src * build to sub-dir * Fixing the few broken tests --------- Co-authored-by: Jon Häggblad <jon.haggblad@gmail.com> Co-authored-by: benedettadavico <benedetta.davico@gmail.com>
72 lines
2.0 KiB
TypeScript
72 lines
2.0 KiB
TypeScript
import expect from 'expect';
|
|
import {
|
|
MixNodeRewarding,
|
|
MixOwnershipResponse,
|
|
PagedMixDelegationsResponse,
|
|
PagedMixNodeBondResponse,
|
|
PagedMixNodeDetailsResponse,
|
|
UnbondedMixnodeResponse,
|
|
} from '@nymproject/types';
|
|
import { TestHelper } from './client';
|
|
import { mixnet, mixnodeowneraddress, mix_id } from './testData';
|
|
|
|
describe('Mixnode mock tests', () => {
|
|
const testHelper = new TestHelper();
|
|
|
|
it('get Mixnode Bonds', () => {
|
|
const execute = testHelper.buildMethod('getMixNodeBonds', [mixnet], <PagedMixNodeBondResponse>{
|
|
nodes: [],
|
|
per_page: 25,
|
|
});
|
|
expect(execute).toBeTruthy();
|
|
});
|
|
|
|
it('get Mixnode Delegations Paged', () => {
|
|
const execute = testHelper.buildMethod('getMixNodeDelegationsPaged', [mixnet, mix_id], <
|
|
PagedMixDelegationsResponse
|
|
>{
|
|
delegations: [],
|
|
per_page: 25,
|
|
});
|
|
expect(execute).toBeTruthy();
|
|
});
|
|
|
|
it('get Mixnodes Detailed', () => {
|
|
const execute = testHelper.buildMethod('getMixNodesDetailed', [mixnet], <PagedMixNodeDetailsResponse>{
|
|
nodes: [],
|
|
per_page: 25,
|
|
});
|
|
expect(execute).toBeTruthy();
|
|
});
|
|
|
|
it('get Mixnode Rewarding Details', () => {
|
|
const execute = testHelper.buildMethod('getMixnodeRewardingDetails', [mixnet, mix_id], <MixNodeRewarding>{
|
|
cost_params: {},
|
|
operator: '',
|
|
delegates: '',
|
|
total_unit_reward: '',
|
|
unit_delegation: '',
|
|
last_rewarded_epoch: 1,
|
|
unique_delegations: 1,
|
|
});
|
|
expect(execute).toBeTruthy();
|
|
});
|
|
|
|
it('get Owned Mixnode', () => {
|
|
const execute = testHelper.buildMethod('getOwnedMixnode', [mixnet, mixnodeowneraddress], <MixOwnershipResponse>{
|
|
address: '',
|
|
mixnode: {},
|
|
});
|
|
expect(execute).toBeTruthy();
|
|
});
|
|
|
|
it('get Unbonded Mixnode Information', () => {
|
|
const execute = testHelper.buildMethod(
|
|
'getUnbondedMixNodeInformation',
|
|
[mixnet, mix_id],
|
|
<UnbondedMixnodeResponse>{},
|
|
);
|
|
expect(execute).toBeTruthy();
|
|
});
|
|
});
|