- commit
- e53b20a502b67f3eccda887449e7812d26016de9
- parent
- 00f1445c1abcc1cde9ad289bc307e830d1ff822a
- author
- Dami <dami.etoile@gmail.com>
| M | test/ | 5 | +++-- |
@@ -98,7 +98,8 @@ describe("fuel", () => {
9898 9999 // Blow past the row-write allowance: writes stop, reads continue.100100 const stub = env.RELAY.getByName("fuel-a");101- await runInDurableObject(stub, async (r: Relay) => r.fuel.record(now(), { rowsWritten: 400_000 }) // 150k over the 250k allowance: 300 sats, which the zap below covers);101+ // 150k over the 250k allowance is 300 sats, which the zap below covers.102+ await runInDurableObject(stub, async (r: Relay) => r.fuel.record(now(), { rowsWritten: 400_000 }));102103 status = await (await SELF.fetch(`http://${host}/fuel`)).json();103104 expect(status.outOfFuel).toBe(true);104105 expect(status.chargedMsats).toBeGreaterThan(0);@@ -144,7 +145,7 @@ describe("fuel", () => {
144145 status = await (await SELF.fetch(`http://${host}/fuel`)).json();145146 expect(status.balanceMsats).toBeLessThan(afterTraffic);146147 // The relay's own rows from this test add a few msats on top.147- const expected = 0.2 * status.rates.satsPerMillionRows * 1000 + 50 * status.rates.satsPerActiveHour * 1000;148+ const expected = 0.15 * status.rates.satsPerMillionRows * 1000 + 50 * status.rates.satsPerActiveHour * 1000; // 150k rows over, 50 hours over148149 expect(status.chargedMsats).toBeGreaterThanOrEqual(expected);149150 expect(status.chargedMsats).toBeLessThan(expected + 5000);150151 });