dsa-connectors/scripts/tests/encodeFlashcastData.ts

14 lines
358 B
TypeScript
Raw Permalink Normal View History

2021-12-05 22:01:27 +00:00
import hre from "hardhat";
2021-12-04 13:08:16 +00:00
const { web3 } = hre;
import { encodeSpells } from "./encodeSpells";
2021-12-04 13:08:16 +00:00
2021-12-05 23:37:37 +00:00
export default function encodeFlashcastData(spells: any) {
2021-12-04 13:08:16 +00:00
const encodeSpellsData = encodeSpells(spells);
2021-12-10 19:10:45 +00:00
let argTypes = ["string[]", "bytes[]"];
2021-12-04 13:08:16 +00:00
return web3.eth.abi.encodeParameters(argTypes, [
encodeSpellsData[0],
encodeSpellsData[1],
]);
};