mirror of
https://github.com/logos-storage/logos-storage-js.git
synced 2026-01-03 05:53:11 +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),
|
||||
tolerance: 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));
|
||||
});
|
||||
|
||||
it("returns an error when trying to create a storage request without collateral", async () => {
|
||||
const { collateral, ...rest } = createStorageRequest();
|
||||
it("returns an error when trying to create a storage request without collateralPerByte", async () => {
|
||||
const { collateralPerByte, ...rest } = createStorageRequest();
|
||||
|
||||
const response = await marketplace.createStorageRequest(rest as any);
|
||||
|
||||
assert.deepStrictEqual(
|
||||
response,
|
||||
missingNumberValidationError("collateral")
|
||||
missingNumberValidationError("collateralPerByte")
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@ -239,7 +239,7 @@ export class CodexMarketplace {
|
||||
pricePerBytePerSecond,
|
||||
proofProbability,
|
||||
nodes,
|
||||
collateral,
|
||||
collateralPerByte,
|
||||
expiry,
|
||||
tolerance,
|
||||
} = result.output;
|
||||
@ -252,7 +252,7 @@ export class CodexMarketplace {
|
||||
pricePerBytePerSecond: pricePerBytePerSecond.toString(),
|
||||
proofProbability: proofProbability.toString(),
|
||||
nodes,
|
||||
collateral: collateral.toString(),
|
||||
collateral: collateralPerByte.toString(),
|
||||
expiry: expiry.toString(),
|
||||
tolerance,
|
||||
}),
|
||||
|
||||
@ -219,7 +219,7 @@ export const CodexCreateStorageRequestInput = v.strictObject({
|
||||
nodes: v.optional(v.number(), 1),
|
||||
tolerance: v.optional(v.number(), 0),
|
||||
expiry: v.pipe(v.number(), v.minValue(1)),
|
||||
collateral: v.number(),
|
||||
collateralPerByte: v.number(),
|
||||
});
|
||||
|
||||
export type CodexCreateStorageRequestInput = v.InferOutput<
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user