Skip to main content
Version: Next

Folder Structure

Currently, Framework expects a specific hierarchy of files inside your base directory. There are no rules that enforce the name of the base directory, but there should be 3 folders inside with names:

  • contracts
  • transactions
  • scripts

Each of those folders shall store corresponding templates types, i.e. contracts folder stores contract templates.

You can have nested folders inside them, but templates in each of those root folders would be treated as of certain type.

Usage

File is in the root of scripts folder

For this simple case you just need to specify name of the file


_10
// Let's assume your base folder is one level above your test
_10
const basePath = path.resolve("../cadence")
_10
const [result, error] = await executeScript("log-message")

File is in nested folder

Let's assume template you want to execute is in scripts/utility/log-message In this case you will need to provide a path relative to scripts folder (no / prefix needed)


_10
// Let's assume your base folder is one level above your test
_10
const basePath = path.resolve("../cadence")
_10
const [result, error] = await executeScript("utility/log-message")