@simbachain/web3-suites
Version:
common code for web3 suite plugins. Code in this repo can be used for truffle or hardhat, but is designed to be applicable to future web3 suite plugins as well.
71 lines • 2.39 kB
TypeScript
/**
* this class is used to compare source code in simba.json to our build artifacts,
* which helps us determine which contracts should/can be exported
*/
export declare class SourceCodeComparer {
private sourceCodeFromSimbaJson;
private sourceCodeFromArtifacts;
private imports;
/**
* grabs source code for all compiled contracts from local build artifacts
* @returns
*/
getAndSetSourceCodeFromArtifacts(): Promise<Record<any, any>>;
/**
* grabs source code from simba.json
* contracts_info.<contract_name> exists after a file has been exported
* @returns
*/
getAndSetSourceCodeFromSimbaJson(): Record<any, any>;
/**
* checks if source code for contractName exists in simba.json
* @param contractName
* @returns
*/
sourceCodeExistsInSimbaJson(contractName: string): boolean;
/**
* checks if source code for contractName exists in artifacts / build dir
* @param contractName
* @returns
*/
sourceCodeExistsInArtifacts(contractName: string): Promise<boolean>;
/**
* compares build artifacts and simba.json to see if contract is new or updated
* @param contractName
* @returns
*/
sourceCodeHasChangedOrIsNew(contractName: string): Promise<boolean>;
/**
* used to communicate to user the status of an attempted export
* @param contractName
* @returns
*/
private getStatusAndMessage;
/**
* calls getStatusAndMessage for each attempted contract export, to communicate
* statuses to user when attempting exports
* @param choices
* @returns
*/
exportStatuses(choices: Array<any> | string): Promise<Record<any, any>>;
/**
* sets simba.json and build artifact source code as property of this class
*/
private initSourceCode;
/**
* sets build artifact source code as property of this class
*/
private initArtifactSourceCode;
/**
* sets simba.json source code as property of this class
*/
private initSimbaJsonSourceCode;
/**
* this method is living in this class because it helps us determine
* what to export or not. If an artifact has empty bytecode,
* then it is an import (dependency), and we don't export it
* @returns
*/
private getAndSetimports;
}
//# sourceMappingURL=source_code_comparer.d.ts.map