mirror of
https://github.com/logos-storage/logos-storage-js.git
synced 2026-01-04 06:23:06 +00:00
Update to use collatealPerByte
This commit is contained in:
parent
ee7e4ee9e8
commit
c910f4d668
@ -17,7 +17,7 @@ function createStorageRequest() {
|
|||||||
nodes: randomInt(1, 5),
|
nodes: randomInt(1, 5),
|
||||||
tolerance: randomInt(1, 100),
|
tolerance: randomInt(1, 100),
|
||||||
expiry: randomInt(1, 100),
|
expiry: randomInt(1, 100),
|
||||||
collateral: randomInt(1, 100),
|
collateralPerByte: randomInt(1, 100),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -366,14 +366,14 @@ describe("marketplace", () => {
|
|||||||
assert.deepStrictEqual(response, minNumberValidationError("expiry", 1));
|
assert.deepStrictEqual(response, minNumberValidationError("expiry", 1));
|
||||||
});
|
});
|
||||||
|
|
||||||
it("returns an error when trying to create a storage request without collateral", async () => {
|
it("returns an error when trying to create a storage request without collateralPerByte", async () => {
|
||||||
const { collateral, ...rest } = createStorageRequest();
|
const { collateralPerByte, ...rest } = createStorageRequest();
|
||||||
|
|
||||||
const response = await marketplace.createStorageRequest(rest as any);
|
const response = await marketplace.createStorageRequest(rest as any);
|
||||||
|
|
||||||
assert.deepStrictEqual(
|
assert.deepStrictEqual(
|
||||||
response,
|
response,
|
||||||
missingNumberValidationError("collateral")
|
missingNumberValidationError("collateralPerByte")
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -239,7 +239,7 @@ export class CodexMarketplace {
|
|||||||
pricePerBytePerSecond,
|
pricePerBytePerSecond,
|
||||||
proofProbability,
|
proofProbability,
|
||||||
nodes,
|
nodes,
|
||||||
collateral,
|
collateralPerByte,
|
||||||
expiry,
|
expiry,
|
||||||
tolerance,
|
tolerance,
|
||||||
} = result.output;
|
} = result.output;
|
||||||
@ -252,7 +252,7 @@ export class CodexMarketplace {
|
|||||||
pricePerBytePerSecond: pricePerBytePerSecond.toString(),
|
pricePerBytePerSecond: pricePerBytePerSecond.toString(),
|
||||||
proofProbability: proofProbability.toString(),
|
proofProbability: proofProbability.toString(),
|
||||||
nodes,
|
nodes,
|
||||||
collateral: collateral.toString(),
|
collateral: collateralPerByte.toString(),
|
||||||
expiry: expiry.toString(),
|
expiry: expiry.toString(),
|
||||||
tolerance,
|
tolerance,
|
||||||
}),
|
}),
|
||||||
|
|||||||
@ -219,7 +219,7 @@ export const CodexCreateStorageRequestInput = v.strictObject({
|
|||||||
nodes: v.optional(v.number(), 1),
|
nodes: v.optional(v.number(), 1),
|
||||||
tolerance: v.optional(v.number(), 0),
|
tolerance: v.optional(v.number(), 0),
|
||||||
expiry: v.pipe(v.number(), v.minValue(1)),
|
expiry: v.pipe(v.number(), v.minValue(1)),
|
||||||
collateral: v.number(),
|
collateralPerByte: v.number(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export type CodexCreateStorageRequestInput = v.InferOutput<
|
export type CodexCreateStorageRequestInput = v.InferOutput<
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user