mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-24 18:22:58 +02:00
CONTRACTS: Generate test contracts on executing host by default. Add support for optional parameter to specify the server. (#2417)
This commit is contained in:
@@ -127,9 +127,11 @@ export function NetscriptCodingContract(): InternalAPI<ICodingContract> {
|
||||
const contract = getCodingContract(ctx, host, filename);
|
||||
return contract.getMaxNumTries() - contract.tries;
|
||||
},
|
||||
createDummyContract: (ctx) => (_type) => {
|
||||
createDummyContract: (ctx) => (_type, _host?) => {
|
||||
const type = getEnumHelper("CodingContractName").nsGetMember(ctx, _type);
|
||||
return generateDummyContract(type);
|
||||
const host = _host ? helpers.string(ctx, "host", _host) : ctx.workerScript.hostname;
|
||||
const server = helpers.getServer(ctx, host);
|
||||
return generateDummyContract(type, server);
|
||||
},
|
||||
getContractTypes: () => () => Object.values(CodingContractName),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user