Update to use collatealPerByte

This commit is contained in:
Arnaud 2025-02-10 22:49:32 +01:00
parent ee7e4ee9e8
commit c910f4d668
No known key found for this signature in database
GPG Key ID: 69D6CE281FCAE663
3 changed files with 7 additions and 7 deletions

View File

@ -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")
); );
}); });
}); });

View File

@ -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,
}), }),

View File

@ -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<