Skip to content

Commit

Permalink
feat: bump nox 0.23.4; bump deal-ts-clients 0.11.1 (#856)
Browse files Browse the repository at this point in the history
  • Loading branch information
justprosh authored Mar 15, 2024
1 parent e05e8e2 commit 07eed08
Show file tree
Hide file tree
Showing 17 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"@fluencelabs/air-beautify-wasm": "0.3.6",
"@fluencelabs/aqua-api": "0.14.2",
"@fluencelabs/aqua-to-js": "0.3.5",
"@fluencelabs/deal-ts-clients": "0.11.0",
"@fluencelabs/deal-ts-clients": "0.11.1",
"@fluencelabs/fluence-network-environment": "1.1.2",
"@fluencelabs/js-client": "0.9.0",
"@fluencelabs/npm-aqua-compiler": "0.0.3",
Expand Down
4 changes: 2 additions & 2 deletions src/commands/chain/proof.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ export default class Proof extends BaseCommand<typeof Proof> {
});

const { dealClient } = await getDealClient();
const capacity = await dealClient.getCapacity();
const capacity = dealClient.getCapacity();
const difficulty = await capacity.difficulty();
const market = await dealClient.getMarket();
const market = dealClient.getMarket();

const unitIds = await market.getComputeUnitIds(
await peerIdToUint8Array(peerId),
Expand Down
2 changes: 1 addition & 1 deletion src/commands/deal/workers-remove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default class RemoveUnit extends BaseCommand<typeof RemoveUnit> {
);

const { dealClient } = await getDealClient();
const market = await dealClient.getMarket();
const market = dealClient.getMarket();

for (const unitId of unitIds) {
await sign(market.returnComputeUnitFromDeal, unitId);
Expand Down
2 changes: 1 addition & 1 deletion src/commands/provider/cc-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default class CCInfo extends BaseCommand<typeof CCInfo> {
async run(): Promise<void> {
const { flags } = await initCli(this, await this.parse(CCInfo));
const { readonlyDealClient } = await getReadonlyDealClient();
const capacity = await readonlyDealClient.getCapacity();
const capacity = readonlyDealClient.getCapacity();
const commitments = await getCommitments(flags);
const { ethers } = await import("ethers");

Expand Down
2 changes: 1 addition & 1 deletion src/commands/provider/deal-exit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default class DealExit extends BaseCommand<typeof DealExit> {
async run(): Promise<void> {
const { args } = await initCli(this, await this.parse(DealExit));
const { dealClient } = await getDealClient();
const market = await dealClient.getMarket();
const market = dealClient.getMarket();

const computeUnits = (
await Promise.all(
Expand Down
2 changes: 1 addition & 1 deletion src/lib/chain/chainId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ import { ensureChainEnv } from "../ensureChainNetwork.js";
export async function getChainId(): Promise<number> {
const chainEnv = await ensureChainEnv();
const { DealClient } = await import("@fluencelabs/deal-ts-clients");
const { chainId } = await DealClient.getContractAddresses(chainEnv);
const { chainId } = DealClient.getContractAddresses(chainEnv);
return chainId;
}
4 changes: 2 additions & 2 deletions src/lib/chain/chainValidators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function getMinCCDuration(): Promise<bigint> {
if ((await ensureChainEnv()) !== "local") {
try {
const { readonlyDealClient } = await getReadonlyDealClient();
const capacity = await readonlyDealClient.getCapacity();
const capacity = readonlyDealClient.getCapacity();
minDuration = await capacity.minDuration();
} catch {}
}
Expand Down Expand Up @@ -74,7 +74,7 @@ async function getProtocolVersions() {

if ((await ensureChainEnv()) !== "local") {
const { readonlyDealClient } = await getReadonlyDealClient();
const core = await readonlyDealClient.getCore();
const core = readonlyDealClient.getCore();

[minProtocolVersion, maxProtocolVersion] = await Promise.all([
core.minProtocolVersion(),
Expand Down
16 changes: 8 additions & 8 deletions src/lib/chain/commitment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export async function getComputePeersWithCC(
computePeers: ResolvedComputePeer[],
) {
const { dealClient } = await getDealClient();
const market = await dealClient.getMarket();
const capacity = await dealClient.getCapacity();
const market = dealClient.getMarket();
const capacity = dealClient.getCapacity();

const commitmentCreatedEvents = Object.fromEntries(
await Promise.all(
Expand Down Expand Up @@ -177,8 +177,8 @@ export async function createCommitments(flags: {
}) {
const computePeers = await resolveComputePeersByNames(flags);
const { dealClient } = await getDealClient();
const core = await dealClient.getCore();
const capacity = await dealClient.getCapacity();
const core = dealClient.getCore();
const capacity = dealClient.getCapacity();
const precision = await core.precision();
const { ethers } = await import("ethers");
const epochDuration = await core.epochDuration();
Expand Down Expand Up @@ -320,7 +320,7 @@ export async function createCommitments(flags: {
export async function removeCommitments(flags: CCFlags) {
const commitments = await getCommitments(flags);
const { dealClient } = await getDealClient();
const capacity = await dealClient.getCapacity();
const capacity = dealClient.getCapacity();

const [commitmentInfoErrors, commitmentInfo] = splitErrorsAndResults(
await Promise.all(
Expand Down Expand Up @@ -388,8 +388,8 @@ export async function removeCommitments(flags: CCFlags) {
export async function withdrawCollateral(flags: CCFlags) {
const commitments = await getCommitments(flags);
const { dealClient } = await getDealClient();
const capacity = await dealClient.getCapacity();
const market = await dealClient.getMarket();
const capacity = dealClient.getCapacity();
const market = dealClient.getMarket();

for (const commitment of commitments) {
const { commitmentId } = commitment;
Expand All @@ -407,7 +407,7 @@ export async function withdrawCollateral(flags: CCFlags) {
export async function withdrawCollateralRewards(flags: CCFlags) {
const commitments = await getCommitments(flags);
const { dealClient } = await getDealClient();
const capacity = await dealClient.getCapacity();
const capacity = dealClient.getCapacity();

// TODO: add logs here
await signBatch(
Expand Down
2 changes: 1 addition & 1 deletion src/lib/chain/currencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export async function getPtDecimals() {
ptDecimalsPromise = (async () => {
const { ethers } = await import("ethers");
const { dealClient, signerOrWallet } = await getDealClient();
const usdc = await dealClient.getUSDC();
const usdc = dealClient.getUSDC();

const decimalsRaw = await signerOrWallet.call({
to: await usdc.getAddress(),
Expand Down
4 changes: 2 additions & 2 deletions src/lib/chain/depositCollateral.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export async function depositCollateral(flags: CCFlags) {
"providerConfigComputePeer" in firstCommitment;

const { dealClient } = await getDealClient();
const capacity = await dealClient.getCapacity();
const capacity = dealClient.getCapacity();

const commitmentsWithCollateral = await Promise.all(
commitments.map(async (commitment) => {
Expand Down Expand Up @@ -99,7 +99,7 @@ Number of compute units: ${color.yellow(

async function getCollateral(commitmentId: string) {
const { dealClient } = await getDealClient();
const capacity = await dealClient.getCapacity();
const capacity = dealClient.getCapacity();
const commitment = await capacity.getCommitment(commitmentId);
return commitment.collateralPerUnit * commitment.unitCount;
}
8 changes: 4 additions & 4 deletions src/lib/chain/offer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ export async function createOffers(flags: OffersArgs) {
const offers = await resolveOffersFromProviderConfig(flags);
await assertProviderIsRegistered();
const { dealClient } = await getDealClient();
const market = await dealClient.getMarket();
const usdc = await dealClient.getUSDC();
const market = dealClient.getMarket();
const usdc = dealClient.getUSDC();
const providerArtifactsConfig = await initNewProviderArtifactsConfig();

const alreadyCreatedOffers = offers.filter(({ offerName }) => {
Expand Down Expand Up @@ -297,7 +297,7 @@ export async function updateOffers(flags: OffersArgs) {
const offers = await resolveOffersFromProviderConfig(flags);
await assertProviderIsRegistered();
const { dealClient } = await getDealClient();
const market = await dealClient.getMarket();
const market = dealClient.getMarket();

const [notCreatedOffers, offersToUpdate] = splitErrorsAndResults(
offers,
Expand Down Expand Up @@ -699,7 +699,7 @@ export async function getOfferInfo(
isAllowedToFail = false,
) {
const { readonlyDealClient } = await getReadonlyDealClient();
const market = await readonlyDealClient.getMarket();
const market = readonlyDealClient.getMarket();
const dealExplorerClient = await getDealExplorerClient();

let offerInfo = undefined;
Expand Down
6 changes: 3 additions & 3 deletions src/lib/chain/providerInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const CURRENTLY_UNUSED_CID =
export async function registerProvider() {
const providerConfig = await ensureReadonlyProviderConfig();
const { dealClient, signerOrWallet } = await getDealClient();
const market = await dealClient.getMarket();
const market = dealClient.getMarket();

const initialProviderInfo = await market.getProviderInfo(
signerOrWallet.address,
Expand Down Expand Up @@ -65,7 +65,7 @@ Provider address: ${signerOrWallet.address}
export async function updateProvider() {
const providerConfig = await ensureReadonlyProviderConfig();
const { dealClient, signerOrWallet } = await getDealClient();
const market = await dealClient.getMarket();
const market = dealClient.getMarket();

const initialProviderInfo = await market.getProviderInfo(
signerOrWallet.address,
Expand Down Expand Up @@ -102,7 +102,7 @@ Provider address: ${signerOrWallet.address}

export async function assertProviderIsRegistered() {
const { dealClient, signerOrWallet } = await getDealClient();
const market = await dealClient.getMarket();
const market = dealClient.getMarket();

const initialProviderInfo = await market.getProviderInfo(
signerOrWallet.address,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/configs/project/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1717,7 +1717,7 @@ async function getDefaultNoxConfigYAML(): Promise<LatestNoxConfigYAML> {
const env = await ensureChainEnv();
const networkId = await getChainId();
const { DealClient } = await import("@fluencelabs/deal-ts-clients");
const contractAddresses = await DealClient.getContractAddresses(env);
const contractAddresses = DealClient.getContractAddresses(env);

return {
aquavmPoolSize: DEFAULT_AQUAVM_POOL_SIZE,
Expand Down
10 changes: 5 additions & 5 deletions src/lib/deal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ export async function dealCreate({
workerName,
}: DealCreateArg) {
const { dealClient } = await getDealClient();
const core = await dealClient.getCore();
const usdc = await dealClient.getUSDC();
const core = dealClient.getCore();
const usdc = dealClient.getUSDC();

const pricePerWorkerEpochBigInt = await ptParse(pricePerWorkerEpoch);
const initialBalanceBigInt = await ptParse(initialBalance);
Expand All @@ -94,7 +94,7 @@ export async function dealCreate({
);
}

const dealFactory = await dealClient.getDealFactory();
const dealFactory = dealClient.getDealFactory();

await sign(
usdc.approve,
Expand Down Expand Up @@ -151,7 +151,7 @@ export async function match(dealAddress: string) {
const { dealClient } = await getDealClient();
const dealMatcherClient = await getDealMatcherClient();
dbg(`running getMatchedOffersByDealId with dealAddress: ${dealAddress}`);
const core = await dealClient.getCore();
const core = dealClient.getCore();

dbg(
`initTimestamp: ${await core.initTimestamp()} Current epoch: ${await core.currentEpoch()}`,
Expand All @@ -174,7 +174,7 @@ export async function match(dealAddress: string) {

dbg(`got matchedOffers: ${stringifyUnknown(matchedOffers)}`);

const market = await dealClient.getMarket();
const market = dealClient.getMarket();

const matchDealTxReceipt = await sign(
market.matchDeal,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/dealClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ async function createDealClient(
await setTryTimeout(
"check if blockchain client is connected",
async () => {
const core = await client.getCore();
const core = client.getCore();
// By calling this method we ensure that the blockchain client is connected
await core.minDealDepositedEpochs();
},
Expand Down
8 changes: 4 additions & 4 deletions src/versions.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"protocolVersion": 1,
"nox": "fluencelabs/nox:0.23.3",
"chain-rpc": "fluencelabs/chain-rpc:0.11.0",
"chain-deploy-script": "fluencelabs/chain-deploy-script:0.11.0",
"subgraph-deploy-script": "fluencelabs/subgraph-deploy-script:0.11.0",
"nox": "fluencelabs/nox:0.23.4",
"chain-rpc": "fluencelabs/chain-rpc:0.11.1",
"chain-deploy-script": "fluencelabs/chain-deploy-script:0.11.1",
"subgraph-deploy-script": "fluencelabs/subgraph-deploy-script:0.11.1",
"rust-toolchain": "nightly-2023-08-27-x86_64",
"npm": {
"@fluencelabs/aqua-lib": "0.9.1",
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ __metadata:
"@fluencelabs/air-beautify-wasm": 0.3.6
"@fluencelabs/aqua-api": 0.14.2
"@fluencelabs/aqua-to-js": 0.3.5
"@fluencelabs/deal-ts-clients": 0.11.0
"@fluencelabs/deal-ts-clients": 0.11.1
"@fluencelabs/fluence-network-environment": 1.1.2
"@fluencelabs/js-client": 0.9.0
"@fluencelabs/npm-aqua-compiler": 0.0.3
Expand Down Expand Up @@ -704,9 +704,9 @@ __metadata:
languageName: unknown
linkType: soft

"@fluencelabs/deal-ts-clients@npm:0.11.0":
version: 0.11.0
resolution: "@fluencelabs/deal-ts-clients@npm:0.11.0"
"@fluencelabs/deal-ts-clients@npm:0.11.1":
version: 0.11.1
resolution: "@fluencelabs/deal-ts-clients@npm:0.11.1"
dependencies:
"@graphql-typed-document-node/core": ^3.2.0
debug: ^4.3.4
Expand All @@ -716,7 +716,7 @@ __metadata:
graphql-request: ^6.1.0
graphql-scalars: ^1.22.4
graphql-tag: ^2.12.6
checksum: 461faafc37f2e9966cf86014fa8f6d85093f3a169fa9a58c81b3a650d0136fc976729dc64f5fc0f0b44f8e1ace4b3fc945570d2bd52017af41e3a7790dce9004
checksum: 6bc9c4c3aa1f3ede12853bb7bf916087f4ca4f458c634ba6491b4bc29a0f5d10b8812a075767a50b53209592f48e9902d363d02fe36311504fc345cdd1a33cb3
languageName: node
linkType: hard

Expand Down

0 comments on commit 07eed08

Please sign in to comment.