Skip to content

Improve Factory tests with Automated deploy / file reading script #30

@tspoff

Description

@tspoff

This could be strait-forward, but there is no modern example.

Problem

We want to deploy a Factory which references the existing App contract for the current network, to find out where the implementations are so we can deploy proxy instances for them.

Solution

A 'deploy' script which will run in front of tests

The script will:

  • Figure out what network we're on
  • If there is no deployment (e.g. new local blockchain), create one (zos publish zos push)
  • Allow the tests to get the current deployed addresses
  • Create a factory instance using zos js (Creating a new logic contract + init is not the same test imo)
  • Run all tests as per normal

I prefer the zos artifacts to the truffle ones, and will be using those in my tests. This is because you can use the zos cli 'create' command via js to deploy instances. The most notable difference is they use web3-style commands to send() and call().

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions