dsa-connectors/scripts/tests/encodeFlashcastData.ts

15 lines
391 B
TypeScript
Raw 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);
const targetType = "string[]";
let argTypes = [targetType, "bytes[]"];
return web3.eth.abi.encodeParameters(argTypes, [
encodeSpellsData[0],
encodeSpellsData[1],
]);
};