-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
featIssue is a featureIssue is a feature
Description
We need a helper function to read bytecode from a file and convert that to a bytearray that users can pass into our sway-libs
functions related to bytecode: https://github.com/FuelLabs/sway-libs/tree/master/libs/bytecode
This conversion is required because the bytecode from a file is a string
, but the type that these Sway functions accept for the bytecode is a Vec<u8>
- which in JavaScript-land is a Vec<BigNumberish>
.
This helper would convert the string to the proper type and ensure all the data is correctly packed.
Possible API
const bytecodeFromFile = readFile(pathToBytecode); // string
const bytecodeVec = generateBytecodeVecFromString(bytecodeFromFile); // our helper -> returns `Vec<BigNumberish>`
await contract.functions.verify_bytecode(bytecodeVec);
Incoming from feedback from the development work being done on the Fuelnaut project: FuelLabs/docs-hub#203
The Fuelnaut project is blocked for now until we figure this out.
petertonysmith94
Metadata
Metadata
Assignees
Labels
featIssue is a featureIssue is a feature