Skip to content

Commit

Permalink
use min 10 FLT
Browse files Browse the repository at this point in the history
  • Loading branch information
shamsartem committed Jan 21, 2025
1 parent e14b3da commit a2aaf22
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 61 deletions.
2 changes: 1 addition & 1 deletion packages/cli/package/src/lib/chain/commitment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ async function getCommitmentsIds(
return getComputePeersWithCCIds(await resolveComputePeersByNames({ flags }));
}

const MIN_PEER_TOKENS_FLT_STR = "5";
const MIN_PEER_TOKENS_FLT_STR = "10";

async function ensurePeersHaveEnoughTokens(
computePeers: ResolvedComputePeer[],
Expand Down
72 changes: 12 additions & 60 deletions packages/cli/package/test/tests/provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,13 @@ describe("provider tests", () => {
await providerConfig.$commit();

const TEST_DEFAULT = {
flags: {
...PRIV_KEY_1,
[OFFER_FLAG_NAME]: NEW_OFFER_NAME,
},
flags: { ...PRIV_KEY_1, [OFFER_FLAG_NAME]: NEW_OFFER_NAME },
cwd,
} as const;

await fluence({
args: ["provider", "tokens-distribute"],
flags: {
...TEST_DEFAULT.flags,
amount: "2.5",
},
flags: { ...TEST_DEFAULT.flags, amount: "5" },
cwd,
});

Expand All @@ -151,60 +145,18 @@ describe("provider tests", () => {
await providerConfig.$commit();
await fluence({ args: ["provider", "update"], flags: PRIV_KEY_1, cwd });
await checkProviderNameIsCorrect(cwd, NEW_PROVIDER_NAME);

await fluence({
args: ["provider", "offer-create"],
...TEST_DEFAULT,
});

await fluence({
args: ["provider", "cc-create"],
...TEST_DEFAULT,
});

await fluence({
args: ["provider", "cc-info"],
...TEST_DEFAULT,
});

await fluence({
args: ["provider", "cc-activate"],
...TEST_DEFAULT,
});

await fluence({
args: ["provider", "cc-info"],
...TEST_DEFAULT,
});

await fluence({ args: ["provider", "offer-create"], ...TEST_DEFAULT });
await fluence({ args: ["provider", "cc-create"], ...TEST_DEFAULT });
await fluence({ args: ["provider", "cc-info"], ...TEST_DEFAULT });
await fluence({ args: ["provider", "cc-activate"], ...TEST_DEFAULT });
await fluence({ args: ["provider", "cc-info"], ...TEST_DEFAULT });
await sleepSeconds(5);

await fluence({
args: ["provider", "cc-info"],
...TEST_DEFAULT,
});

await fluence({ args: ["provider", "cc-info"], ...TEST_DEFAULT });
await sleepSeconds(CC_DURATION_SECONDS);

await fluence({
args: ["provider", "cc-info"],
...TEST_DEFAULT,
});

await fluence({
args: ["provider", "cc-finish"],
...TEST_DEFAULT,
});

await fluence({
args: ["provider", "cc-info"],
...TEST_DEFAULT,
});

await fluence({
args: ["provider", "offer-remove"],
...TEST_DEFAULT,
});
await fluence({ args: ["provider", "cc-info"], ...TEST_DEFAULT });
await fluence({ args: ["provider", "cc-finish"], ...TEST_DEFAULT });
await fluence({ args: ["provider", "cc-info"], ...TEST_DEFAULT });
await fluence({ args: ["provider", "offer-remove"], ...TEST_DEFAULT });
},
);

Expand Down

0 comments on commit a2aaf22

Please sign in to comment.