Closed Netherdrake closed 6 years ago
Perhaps the testrpc/tester state is ephemeral, and bound to individual Project.get_chain scope?
Basically, yes.
You could do the
with Project().get_chain(chain_name) as chain:
block in your __name__ == '__main__'
block, and pass chain
around.
Thanks for the heads up.
In my real-world case, these deployments are run at separate times (over span of months), so there is absolutely no way to share a chain
instance there.
I suppose I could refactor my codebase to share the chain
for testrpc
and tester
, and do the partial application for testnet
and mainnet
.
I am trying to deploy contracts that link to (use) previously deployed contracts.
To make things simple, I'm basing this issue on vanilla
Greeter
contract as produced bypopulus init
in 2.2.0.Here is a much simplified deployment script to present the issue I'm running into.
The above code will fail. For some reason, the Greeter contract instance in a
load()
'swith Project().get_chain(chain_name) as chain:
scope will be unusable, and throw errors such as:In the case of calling into another (already deployed contract), the transaction will fail. I tried inspecting instances from different scopes by comparing the address/abi/code/bytecode and they seem to be the same, so I don't see an obvious reason for why this fails.
Perhaps the
testrpc
/tester
state is ephemeral, and bound to individualProject.get_chain
scope?I wanted to try with a Ropsten testnet, but unfortunately I'm having some trouble with that as well.