dapp-scratch
dapp-scratch copied to clipboard
Refactorization to manage multiple contracts
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 is the identity observer just for the Haello app?
@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.