Stop nesting interfaces and add necessary type exports

This commit is contained in:
Fabio Berger 2018-08-23 17:28:27 +01:00
parent f9b222c127
commit c4c47d9665
2 changed files with 31 additions and 20 deletions

View File

@ -326,24 +326,21 @@ export interface ContractNetworkData {
export interface StandardContractOutput { export interface StandardContractOutput {
abi: ContractAbi; abi: ContractAbi;
evm: { evm: EvmOutput;
bytecode: { }
object: string;
sourceMap: string; export interface EvmOutput {
}; bytecode: EvmBytecodeOutput;
deployedBytecode: { deployedBytecode: EvmBytecodeOutput;
object: string; }
sourceMap: string;
}; export interface EvmBytecodeOutput {
}; object: string;
sourceMap: string;
} }
export interface ContractVersionData { export interface ContractVersionData {
compiler: { compiler: CompilerOpts;
name: 'solc';
version: string;
settings: CompilerSettings;
};
sources: { sources: {
[sourceName: string]: { [sourceName: string]: {
id: number; id: number;
@ -356,6 +353,12 @@ export interface ContractVersionData {
compilerOutput: StandardContractOutput; compilerOutput: StandardContractOutput;
} }
export interface CompilerOpts {
name: 'solc';
version: string;
settings: CompilerSettings;
}
/** /**
* This type defines the schema of the artifact.json file generated by Sol-compiler * This type defines the schema of the artifact.json file generated by Sol-compiler
* schemaVersion: The version of the artifact schema * schemaVersion: The version of the artifact schema
@ -384,10 +387,7 @@ export interface GeneratedCompilerOptions {
// Copied from the solc.js library types // Copied from the solc.js library types
export interface CompilerSettings { export interface CompilerSettings {
remappings?: string[]; remappings?: string[];
optimizer?: { optimizer?: OptimizerSettings;
enabled: boolean;
runs?: number;
};
evmVersion?: 'homestead' | 'tangerineWhistle' | 'spuriousDragon' | 'byzantium' | 'constantinople'; evmVersion?: 'homestead' | 'tangerineWhistle' | 'spuriousDragon' | 'byzantium' | 'constantinople';
metadata?: CompilerSettingsMetadata; metadata?: CompilerSettingsMetadata;
libraries?: { libraries?: {
@ -406,6 +406,11 @@ export interface CompilerSettingsMetadata {
useLiteralContent: true; useLiteralContent: true;
} }
export interface OptimizerSettings {
enabled: boolean;
runs?: number;
}
export interface Source { export interface Source {
id: number; id: number;
} }

View File

@ -1,2 +1,8 @@
export { Compiler } from './compiler'; export { Compiler } from './compiler';
export { CompilerOptions, CompilerSettings, OutputField } from 'ethereum-types'; export {
CompilerOptions,
CompilerSettings,
OutputField,
CompilerSettingsMetadata,
OptimizerSettings,
} from 'ethereum-types';