@metamask/snaps-simulation
Version:
A simulation framework for MetaMask Snaps, enabling headless testing of Snaps in a controlled environment
23 lines • 871 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getChainIdHandler = void 0;
/**
* A mock handler for eth_chainId that always returns a specific
* hardcoded result.
*
* @param _request - Incoming JSON-RPC request. Ignored for this specific
* handler.
* @param response - The outgoing JSON-RPC response, modified to return the
* result.
* @param _next - The `json-rpc-engine` middleware next handler.
* @param end - The `json-rpc-engine` middleware end handler.
* @returns The JSON-RPC response.
*/
async function getChainIdHandler(_request, response, _next, end) {
// For now this will return a mocked result, this should probably match
// whatever network the simulation is using.
response.result = '0x01';
return end();
}
exports.getChainIdHandler = getChainIdHandler;
//# sourceMappingURL=chain-id.cjs.map