API: Remove RAM cost of hacknet namespace and set RAM cost of each hacknet API (#2502)

* API: Remove RAM cost of hacknet namespace and set RAM cost of each hacknet API

* Fix Jest tests

* Update based on feedback
This commit is contained in:
catloversg
2026-02-17 00:00:02 +07:00
committed by GitHub
parent 775a1b1e4b
commit dd78a2cb44
6 changed files with 58 additions and 48 deletions

View File

@@ -140,13 +140,8 @@ describe("Netscript RAM Calculation/Generation Tests", function () {
const expectedRam = grabCost(ramLayer[key]);
it(`${fnName}()`, () => combinedRamCheck(fn, newPath, expectedRam, extraLayerCost));
}
//A layer should be the only other option. Hacknet is currently the only layer with a layer cost.
else if (typeof val === "object" && key !== "enums") {
//hacknet is currently the only layer with a layer cost.
const layerCost = key === "hacknet" ? 4 : 0;
testLayer(val as InternalAPI<unknown>, externalLayer[key], ramLayer[key], newPath, layerCost);
}
// Other things like args, enums, etc. have no cost
// A layer should be the only other option, but we don't have any of those with a cost.
// Other things like args, enums, etc. have no cost.
}
});
}