From 82c66b796f4fa0037ef25f0253af96ddb14e2d0a Mon Sep 17 00:00:00 2001 From: shark0der Date: Thu, 4 May 2023 17:07:46 +0300 Subject: [PATCH] Remove obsolete test/fork/external.js file --- test/fork/external.js | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 test/fork/external.js diff --git a/test/fork/external.js b/test/fork/external.js deleted file mode 100644 index 46e77316f4..0000000000 --- a/test/fork/external.js +++ /dev/null @@ -1,31 +0,0 @@ -const abi = require('ethereumjs-abi'); -const { hex } = require('../utils').helpers; - -function encode(...args) { - const signature = args[0]; - const params = args.slice(1); - const datatypes = signature - .substring(0, signature.length - 1) - .split('(')[1] - .split(','); - - for (let i = 0; i < datatypes.length; i++) { - if (datatypes[i].includes('byte') && !datatypes[i].includes('[]')) { - if (!params[i].startsWith('0x')) { - params[i] = hex(params[i]); - args[i + 1] = params[i]; - } - } - } - - const encoded = abi.simpleEncode.apply(this, args); - - return '0x' + encoded.toString('hex'); -} - -function encode1(...args) { - const encoded = abi.rawEncode.apply(this, args); - return '0x' + encoded.toString('hex'); -} - -module.exports = { encode, encode1 };