dapp-scratch icon indicating copy to clipboard operation
dapp-scratch copied to clipboard

Refactorization to manage multiple contracts

Open tillkolter opened this issue 6 years ago • 2 comments

During the playground phase of my contribution for the Aeternity hackathon, I found myself with two contracts soon. I realised, that the current CLI only generated a javascript contract wrapper at a time, overwriting the last generation.

This could be easily fixed by removing the line in DappScratch.writeWrapper which deleted the old dapp-scratch-wrapper folder, but I also found, that having more than one contract, the initialisation part for web3 and the account initialisation should not be part of the contract wrapper class in a scenario that manages more than one contract, so I separated the contracts from the initialisation part and introduced a manager class, that manages the account related initialisation and instantiates the contracts.

tillkolter avatar Dec 05 '17 07:12 tillkolter

@tillkolter is the identity observer just for the Haello app?

okwme avatar Dec 19 '17 16:12 okwme

@okwme well, I needed it for my scenario, because I wanted to be informed when the account is "identified" to query more identity specific details from the contract. I thought this kind of pattern might be helpful for others as well.

tillkolter avatar Dec 22 '17 07:12 tillkolter