LiskArchive / lisk-sdk

🔩 Lisk software development kit

Home Page:https://lisk.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement load and init methods of RecoveryPlugin class

ishantiw opened this issue · comments

Description

Implement load and init methods of RecoveryPlugin class

class RecoveryPlugin extends BasePlugin {
        private _recoveryManager: SidechainRecoveryManager | MainchainRecoveryManager;

	init(context: PluginInitContext<Record<string, unknown>>): Promise<void> {
		// assign all the config params
	}

	load(): Promise<void> {
		// check whether the chain is mainchain or sidechain

		if (mainchain) {
			this._recoveryManager = new MainchainRecoveryManager()
		} else {
                  // check for mainchainIPC/WS path in config and create               
                     mainchainClient and pass mainchainClient
			this._recoveryManager = new SidechainRecoveryManager()
		}
	}

       // call clean up on RecoveryManager to cleanup apiClients before app shutdown
        unload () {}
}

Acceptance Criteria

  • Should have all the unit test