Open EmanHerawy opened 4 years ago
Good job @EmanHerawy Keep going 👍🏼
Interesting problem, thanks for bringing to our attention!
I think the solution here is non-trivial, since that networkType
field shouldn't necessarily live in that location - for instance, the same contract could be used for both quorum
and ethereum
network types, so networkType
should theoretically be a property per-network.
I think we should wait to add this field to the artifacts until we can move it to the right place. In the meantime, you might be stuck with the workaround of manually putting it there (sorry!).
Putting this on our backlog to revisit in the near/mid future. Thanks again!
Interesting problem, thanks for bringing to our attention!
I think the solution here is non-trivial, since that
networkType
field shouldn't necessarily live in that location - for instance, the same contract could be used for bothquorum
andethereum
network types, sonetworkType
should theoretically be a property per-network.I think we should wait to add this field to the artifacts until we can move it to the right place. In the meantime, you might be stuck with the workaround of manually putting it there (sorry!).
Putting this on our backlog to revisit in the near/mid future. Thanks again!
Thanks for your decent reply!
I Would love to help in fixing this if someone just guide me & I'm thinking of two ways of fixing :
1- fix it in truffle-contract
( something like add the network type with the provider) , in my opnion this is better and easier
2- fix it in contract artifacts , by adding networkType
in each network deploy and force compile with each migration ( because we might need to deploy the same contract to different networks )and that require adjusting the truffle-contract
as well to get this value from this nested object .
Issue
Hi all, I'm developing a react native app using ( kaleido quorum network , truffle and truffle-contract & web3js) but it doesn't work well with non migrated contract in the front end , if i'm calling any migrated contract , it works fine .
What the issue is, in broad strokes. I'm using factory contract to create new contract " these contract are not migrated " whenever I try to call them , I found this issue
How I could solve it
I have updated the contract artifacts by adding
"networkType": "quorum"
, and it works fine nowEnvironment
truffle version
): Truffle v5.1.9node --version
): node v10.18.1npm --version
): npm v6.13.4I'm not sure what is the best way to solve the issue, I was thinking of forcing compilation when migration and adjust the artifacts based on the migration network config but I found that this is not the best solution as we sometimes we need to migrate the files to multiple networks . this issue is just to save other developers time , if anyone has encountered the same problem