aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-08-24 00:28:27 +0800
committerFabio Berger <me@fabioberger.com>2018-08-24 00:28:27 +0800
commitc4c47d9665e7a4afef2adc7b717f29996fc96f59 (patch)
tree1d88867c5d746958d20c51b1de4890caefd5b80f /packages
parentf9b222c12728ed004688521314932a2a0062f5bd (diff)
downloaddexon-sol-tools-c4c47d9665e7a4afef2adc7b717f29996fc96f59.tar
dexon-sol-tools-c4c47d9665e7a4afef2adc7b717f29996fc96f59.tar.gz
dexon-sol-tools-c4c47d9665e7a4afef2adc7b717f29996fc96f59.tar.bz2
dexon-sol-tools-c4c47d9665e7a4afef2adc7b717f29996fc96f59.tar.lz
dexon-sol-tools-c4c47d9665e7a4afef2adc7b717f29996fc96f59.tar.xz
dexon-sol-tools-c4c47d9665e7a4afef2adc7b717f29996fc96f59.tar.zst
dexon-sol-tools-c4c47d9665e7a4afef2adc7b717f29996fc96f59.zip
Stop nesting interfaces and add necessary type exports
Diffstat (limited to 'packages')
-rw-r--r--packages/ethereum-types/src/index.ts43
-rw-r--r--packages/sol-compiler/src/index.ts8
2 files changed, 31 insertions, 20 deletions
diff --git a/packages/ethereum-types/src/index.ts b/packages/ethereum-types/src/index.ts
index 2b878ca53..3b6fdc77b 100644
--- a/packages/ethereum-types/src/index.ts
+++ b/packages/ethereum-types/src/index.ts
@@ -326,24 +326,21 @@ export interface ContractNetworkData {
export interface StandardContractOutput {
abi: ContractAbi;
- evm: {
- bytecode: {
- object: string;
- sourceMap: string;
- };
- deployedBytecode: {
- object: string;
- sourceMap: string;
- };
- };
+ evm: EvmOutput;
+}
+
+export interface EvmOutput {
+ bytecode: EvmBytecodeOutput;
+ deployedBytecode: EvmBytecodeOutput;
+}
+
+export interface EvmBytecodeOutput {
+ object: string;
+ sourceMap: string;
}
export interface ContractVersionData {
- compiler: {
- name: 'solc';
- version: string;
- settings: CompilerSettings;
- };
+ compiler: CompilerOpts;
sources: {
[sourceName: string]: {
id: number;
@@ -356,6 +353,12 @@ export interface ContractVersionData {
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
* schemaVersion: The version of the artifact schema
@@ -384,10 +387,7 @@ export interface GeneratedCompilerOptions {
// Copied from the solc.js library types
export interface CompilerSettings {
remappings?: string[];
- optimizer?: {
- enabled: boolean;
- runs?: number;
- };
+ optimizer?: OptimizerSettings;
evmVersion?: 'homestead' | 'tangerineWhistle' | 'spuriousDragon' | 'byzantium' | 'constantinople';
metadata?: CompilerSettingsMetadata;
libraries?: {
@@ -406,6 +406,11 @@ export interface CompilerSettingsMetadata {
useLiteralContent: true;
}
+export interface OptimizerSettings {
+ enabled: boolean;
+ runs?: number;
+}
+
export interface Source {
id: number;
}
diff --git a/packages/sol-compiler/src/index.ts b/packages/sol-compiler/src/index.ts
index b6b170508..f8c2b577a 100644
--- a/packages/sol-compiler/src/index.ts
+++ b/packages/sol-compiler/src/index.ts
@@ -1,2 +1,8 @@
export { Compiler } from './compiler';
-export { CompilerOptions, CompilerSettings, OutputField } from 'ethereum-types';
+export {
+ CompilerOptions,
+ CompilerSettings,
+ OutputField,
+ CompilerSettingsMetadata,
+ OptimizerSettings,
+} from 'ethereum-types';