Skip to content

Commit

Permalink
chore: Update cluster creation/bonding flow in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
skambalin committed Oct 22, 2024
1 parent fc8ad6d commit 686552a
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions tests/specs/Blockchain.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { Blockchain, ClusterNodeKind, ClusterProps, ClusterStatus, StorageNodeMode } from '@cere-ddc-sdk/blockchain';
import { Blockchain, ClusterNodeKind, ClusterParams, ClusterStatus, StorageNodeMode } from '@cere-ddc-sdk/blockchain';
import { cryptoWaitReady, randomAsHex } from '@polkadot/util-crypto';
import { ApiPromise } from '@polkadot/api';
import { KeyringPair } from '@polkadot/keyring/types';

import { createAccount, createBlockhainApi, sendMultipleTransfers } from '../helpers';
import { CERE, createAccount, createBlockhainApi, sendMultipleTransfers } from '../helpers';

describe('Blockchain', () => {
const bondSize = 100n * CERE;

let apiPromise: ApiPromise;
let blockchain: Blockchain;

Expand All @@ -16,23 +18,22 @@ describe('Blockchain', () => {
let storageNode2Key: string;
let storageNode3Key: string;
let nonExistentKey1: string;
const bondSize = 10_000_000_000n;

const clusterId = randomAsHex(20);
const clusterProps: ClusterProps = {
const clusterProps: ClusterParams = {
nodeProviderAuthContract: null,
erasureCodingRequired: 4,
erasureCodingTotal: 6,
replicationTotal: 3,
};

const clusterGovernmentParams = {
treasuryShare: 0,
validatorsShare: 0,
clusterReserveShare: 0,
treasuryShare: 100000000,
validatorsShare: 100000000,
clusterReserveShare: 100000000,
storageBondSize: bondSize,
storageChillDelay: 0,
storageUnbondingDelay: 0,
storageChillDelay: 20,
storageUnbondingDelay: 20,
unitPerMbStored: 0n,
unitPerMbStreamed: 0n,
unitPerPutRequest: 0n,
Expand All @@ -53,9 +54,9 @@ describe('Blockchain', () => {
apiPromise = await createBlockhainApi();

await sendMultipleTransfers(apiPromise, [
{ to: userAccount.address, tokens: 100 },
{ to: storageNode1Account.address, tokens: 10 },
{ to: nodeProviderAccount.address, tokens: 10 },
{ to: userAccount.address, tokens: 500 },
{ to: storageNode1Account.address, tokens: 500 },
{ to: nodeProviderAccount.address, tokens: 500 },
]);
});

Expand Down Expand Up @@ -144,7 +145,7 @@ describe('Blockchain', () => {
});

test('Should set cluster props', async () => {
const clusterProps: ClusterProps = {
const clusterProps: ClusterParams = {
nodeProviderAuthContract: null,
erasureCodingRequired: 4,
erasureCodingTotal: 6,
Expand Down

0 comments on commit 686552a

Please sign in to comment.