Skip to content
This repository has been archived by the owner on Jun 11, 2019. It is now read-only.

dapplescript environment usability issue #367

Open
nmushegian opened this issue Nov 18, 2016 · 1 comment
Open

dapplescript environment usability issue #367

nmushegian opened this issue Nov 18, 2016 · 1 comment

Comments

@nmushegian
Copy link
Member

If I have this workflow:

dapple chain new testfork
dapple script run Setup

then write a test which refers to an environment object mycontract

dapple test -r MyContractTest.t.sol

Now I push and the next dev tries to replicate the forked env:

dapple chain new testfork
dapple script run Setup

But it doesn't even compile because mycontract is not defined in Env!

I think this means the environment should be loaded as a mapping and not hoisted into the actual contract

@mhhf
Copy link
Member

mhhf commented Nov 18, 2016

Hmmm, this is a tricky one.
with mappings we would need to map to addresses and loose type safety which means we would need to adapt something like @dbrock suggested:

MyContract(env.getObj("mycontract")).dostuff();

or something like (dunno if this is even possible):

env.MyContract("mycontract").dostuff();

in comparison with todays:

env.mycontract.dostuff();

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants