```\n// Make sure we can actually buy the resource amount requested by the user.\nparams.prevBoughtGas += _amount;\nrequire(\n    int256(uint256(params.prevBoughtGas)) <= MAX_RESOURCE_LIMIT,\n    "ResourceMetering: cannot buy more gas than available gas limit"\n);\n```\n