@ethereumjs/evm
Version:
JavaScript Ethereum Virtual Machine (EVM) implementation
30 lines • 1.37 kB
TypeScript
import type { PrecompileInput } from './index.ts';
/**
* Checks that the gas used remain under the gas limit.
*
* @param opts - Precompile input wrapper
* @param gasUsed - Amount of gas consumed by the precompile
* @param pName - Human readable precompile name for logging
* @returns `true` if the gas usage is within the provided limit
*/
export declare const gasLimitCheck: (opts: PrecompileInput, gasUsed: bigint, pName: string) => boolean;
/**
* Checks that the length of the provided data is equal to `length`.
*
* @param opts - Precompile input wrapper
* @param length - Required data length in bytes
* @param pName - Human readable precompile name for logging
* @returns `true` if the provided data matches the required length
*/
export declare const equalityLengthCheck: (opts: PrecompileInput, length: number, pName: string) => boolean;
/**
* Checks that the total length of the provided data input can be subdivided into k equal parts
* with `length` (without leaving some remainder bytes).
*
* @param opts - Precompile input wrapper
* @param length - Required chunk size
* @param pName - Human readable precompile name for logging
* @returns `true` if the length is divisible by the chunk size
*/
export declare const moduloLengthCheck: (opts: PrecompileInput, length: number, pName: string) => boolean;
//# sourceMappingURL=util.d.ts.map