745 lines
12 KiB
Plaintext
745 lines
12 KiB
Plaintext
|
|
|
|
# Class: AbstractArtifactAdapter
|
|
|
|
|
|
## Methods
|
|
|
|
### `Abstract` collectContractsDataAsync
|
|
|
|
▸ **collectContractsDataAsync**(): *`Promise<ContractData[]>`*
|
|
|
|
*Defined in [sol-tracing-utils/src/artifact_adapters/abstract_artifact_adapter.ts:4](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/sol-tracing-utils/src/artifact_adapters/abstract_artifact_adapter.ts#L4)*
|
|
|
|
**Returns:** *`Promise<ContractData[]>`*
|
|
|
|
<hr />
|
|
|
|
# Class: SolCompilerArtifactAdapter
|
|
|
|
|
|
## Constructors
|
|
|
|
|
|
|
|
\+ **new SolCompilerArtifactAdapter**(`artifactsPath?`: undefined | string, `sourcesPath?`: undefined | string): *[SolCompilerArtifactAdapter](#class-solcompilerartifactadapter)*
|
|
|
|
*Defined in [sol-tracing-utils/src/artifact_adapters/sol_compiler_artifact_adapter.ts:18](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/sol-tracing-utils/src/artifact_adapters/sol_compiler_artifact_adapter.ts#L18)*
|
|
|
|
Instantiates a SolCompilerArtifactAdapter
|
|
|
|
**Parameters:**
|
|
|
|
Name | Type | Description |
|
|
------ | ------ | ------ |
|
|
`artifactsPath?` | undefined \| string | Path to your artifacts directory |
|
|
`sourcesPath?` | undefined \| string | Path to your contract sources directory |
|
|
|
|
**Returns:** *[SolCompilerArtifactAdapter](#class-solcompilerartifactadapter)*
|
|
|
|
## Methods
|
|
|
|
### collectContractsDataAsync
|
|
|
|
▸ **collectContractsDataAsync**(): *`Promise<ContractData[]>`*
|
|
|
|
*Overrides [AbstractArtifactAdapter](_sol_tracing_utils_src_artifact_adapters_abstract_artifact_adapter_.abstractartifactadapter.md).[collectContractsDataAsync](#abstract-collectcontractsdataasync)*
|
|
|
|
*Defined in [sol-tracing-utils/src/artifact_adapters/sol_compiler_artifact_adapter.ts:44](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/sol-tracing-utils/src/artifact_adapters/sol_compiler_artifact_adapter.ts#L44)*
|
|
|
|
**Returns:** *`Promise<ContractData[]>`*
|
|
|
|
<hr />
|
|
|
|
# Class: TruffleArtifactAdapter
|
|
|
|
|
|
## Constructors
|
|
|
|
|
|
|
|
\+ **new TruffleArtifactAdapter**(`projectRoot`: string, `solcVersion`: string): *[TruffleArtifactAdapter](#class-truffleartifactadapter)*
|
|
|
|
*Defined in [sol-tracing-utils/src/artifact_adapters/truffle_artifact_adapter.ts:29](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/sol-tracing-utils/src/artifact_adapters/truffle_artifact_adapter.ts#L29)*
|
|
|
|
Instantiates a TruffleArtifactAdapter
|
|
|
|
**Parameters:**
|
|
|
|
Name | Type | Description |
|
|
------ | ------ | ------ |
|
|
`projectRoot` | string | Path to the truffle project's root directory |
|
|
`solcVersion` | string | Solidity version with which to compile all the contracts |
|
|
|
|
**Returns:** *[TruffleArtifactAdapter](#class-truffleartifactadapter)*
|
|
|
|
## Methods
|
|
|
|
### collectContractsDataAsync
|
|
|
|
▸ **collectContractsDataAsync**(): *`Promise<ContractData[]>`*
|
|
|
|
*Overrides [AbstractArtifactAdapter](_sol_tracing_utils_src_artifact_adapters_abstract_artifact_adapter_.abstractartifactadapter.md).[collectContractsDataAsync](#abstract-collectcontractsdataasync)*
|
|
|
|
*Defined in [sol-tracing-utils/src/artifact_adapters/truffle_artifact_adapter.ts:40](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/sol-tracing-utils/src/artifact_adapters/truffle_artifact_adapter.ts#L40)*
|
|
|
|
**Returns:** *`Promise<ContractData[]>`*
|
|
|
|
<hr />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Type aliases
|
|
|
|
### Callback
|
|
|
|
Ƭ **Callback**: *function*
|
|
|
|
*Defined in [subproviders/src/types.ts:131](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/subproviders/src/types.ts#L131)*
|
|
|
|
#### Type declaration:
|
|
|
|
▸ (): *void*
|
|
|
|
___
|
|
|
|
|
|
|
|
### ErrorCallback
|
|
|
|
Ƭ **ErrorCallback**: *function*
|
|
|
|
*Defined in [subproviders/src/types.ts:130](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/subproviders/src/types.ts#L130)*
|
|
|
|
#### Type declaration:
|
|
|
|
▸ (`err`: `Error` | null, `data?`: any): *void*
|
|
|
|
**Parameters:**
|
|
|
|
Name | Type |
|
|
------ | ------ |
|
|
`err` | `Error` \| null |
|
|
`data?` | any |
|
|
|
|
___
|
|
|
|
|
|
|
|
### NextCallback
|
|
|
|
Ƭ **NextCallback**: *function*
|
|
|
|
*Defined in [subproviders/src/types.ts:133](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/subproviders/src/types.ts#L133)*
|
|
|
|
#### Type declaration:
|
|
|
|
▸ (`callback?`: [OnNextCompleted](#onnextcompleted)): *void*
|
|
|
|
**Parameters:**
|
|
|
|
Name | Type |
|
|
------ | ------ |
|
|
`callback?` | [OnNextCompleted](#onnextcompleted) |
|
|
|
|
___
|
|
|
|
### OnNextCompleted
|
|
|
|
Ƭ **OnNextCompleted**: *function*
|
|
|
|
*Defined in [subproviders/src/types.ts:132](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/subproviders/src/types.ts#L132)*
|
|
|
|
#### Type declaration:
|
|
|
|
▸ (`err`: `Error` | null, `result`: any, `cb`: [Callback](#callback)): *void*
|
|
|
|
**Parameters:**
|
|
|
|
Name | Type |
|
|
------ | ------ |
|
|
`err` | `Error` \| null |
|
|
`result` | any |
|
|
`cb` | [Callback](#callback) |
|
|
|
|
<hr />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Interface: JSONRPCRequestPayload
|
|
|
|
|
|
## Properties
|
|
|
|
### id
|
|
|
|
• **id**: *number*
|
|
|
|
*Defined in [ethereum-types/src/index.ts:331](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/ethereum-types/src/index.ts#L331)*
|
|
|
|
___
|
|
|
|
### jsonrpc
|
|
|
|
• **jsonrpc**: *string*
|
|
|
|
*Defined in [ethereum-types/src/index.ts:332](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/ethereum-types/src/index.ts#L332)*
|
|
|
|
___
|
|
|
|
### method
|
|
|
|
• **method**: *string*
|
|
|
|
*Defined in [ethereum-types/src/index.ts:330](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/ethereum-types/src/index.ts#L330)*
|
|
|
|
___
|
|
|
|
### params
|
|
|
|
• **params**: *any[]*
|
|
|
|
*Defined in [ethereum-types/src/index.ts:329](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/ethereum-types/src/index.ts#L329)*
|
|
|
|
<hr />
|
|
|
|
# Interface: JSONRPCResponseError
|
|
|
|
|
|
## Properties
|
|
|
|
### code
|
|
|
|
• **code**: *number*
|
|
|
|
*Defined in [ethereum-types/src/index.ts:337](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/ethereum-types/src/index.ts#L337)*
|
|
|
|
___
|
|
|
|
### message
|
|
|
|
• **message**: *string*
|
|
|
|
*Defined in [ethereum-types/src/index.ts:336](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/ethereum-types/src/index.ts#L336)*
|
|
|
|
<hr />
|
|
|
|
# Interface: JSONRPCResponsePayload
|
|
|
|
|
|
## Properties
|
|
|
|
### `Optional` error
|
|
|
|
• **error**? : *[JSONRPCResponseError](#class-jsonrpcresponseerror)*
|
|
|
|
*Defined in [ethereum-types/src/index.ts:344](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/ethereum-types/src/index.ts#L344)*
|
|
|
|
___
|
|
|
|
### id
|
|
|
|
• **id**: *number*
|
|
|
|
*Defined in [ethereum-types/src/index.ts:342](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/ethereum-types/src/index.ts#L342)*
|
|
|
|
___
|
|
|
|
### jsonrpc
|
|
|
|
• **jsonrpc**: *string*
|
|
|
|
*Defined in [ethereum-types/src/index.ts:343](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/ethereum-types/src/index.ts#L343)*
|
|
|
|
___
|
|
|
|
### result
|
|
|
|
• **result**: *any*
|
|
|
|
*Defined in [ethereum-types/src/index.ts:341](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/ethereum-types/src/index.ts#L341)*
|
|
|
|
<hr />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Class: CoverageSubprovider
|
|
|
|
This class implements the [web3-provider-engine](https://github.com/MetaMask/provider-engine) subprovider interface.
|
|
It's used to compute your code coverage while running solidity tests.
|
|
|
|
|
|
## Constructors
|
|
|
|
|
|
|
|
\+ **new CoverageSubprovider**(`artifactAdapter`: `AbstractArtifactAdapter`, `defaultFromAddress`: string, `partialConfig`: [CoverageSubproviderPartialConfig](#coveragesubproviderpartialconfig)): *[CoverageSubprovider](#class-coveragesubprovider)*
|
|
|
|
*Overrides void*
|
|
|
|
*Defined in [sol-coverage/src/coverage_subprovider.ts:44](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/sol-coverage/src/coverage_subprovider.ts#L44)*
|
|
|
|
Instantiates a CoverageSubprovider instance
|
|
|
|
**Parameters:**
|
|
|
|
Name | Type | Default | Description |
|
|
------ | ------ | ------ | ------ |
|
|
`artifactAdapter` | `AbstractArtifactAdapter` | - | Adapter for used artifacts format (0x, truffle, giveth, etc.) |
|
|
`defaultFromAddress` | string | - | default from address to use when sending transactions |
|
|
`partialConfig` | [CoverageSubproviderPartialConfig](#coveragesubproviderpartialconfig) | {} | Partial configuration object |
|
|
|
|
**Returns:** *[CoverageSubprovider](#class-coveragesubprovider)*
|
|
|
|
## Methods
|
|
|
|
### emitPayloadAsync
|
|
|
|
▸ **emitPayloadAsync**(`payload`: `Partial<JSONRPCRequestPayloadWithMethod>`): *`Promise<JSONRPCResponsePayload>`*
|
|
|
|
|
|
|
|
Defined in subproviders/lib/src/subproviders/subprovider.d.ts:25
|
|
|
|
Emits a JSON RPC payload that will then be handled by the ProviderEngine instance
|
|
this subprovider is a part of. The payload will cascade down the subprovider middleware
|
|
stack until finding the responsible entity for handling the request.
|
|
|
|
**Parameters:**
|
|
|
|
Name | Type | Description |
|
|
------ | ------ | ------ |
|
|
`payload` | `Partial<JSONRPCRequestPayloadWithMethod>` | JSON RPC payload |
|
|
|
|
**Returns:** *`Promise<JSONRPCResponsePayload>`*
|
|
|
|
JSON RPC response payload
|
|
|
|
___
|
|
|
|
### handleRequest
|
|
|
|
▸ **handleRequest**(`payload`: `JSONRPCRequestPayload`, `next`: [NextCallback](#nextcallback), `_end`: [ErrorCallback](#errorcallback)): *`Promise<void>`*
|
|
|
|
|
|
|
|
*Overrides void*
|
|
|
|
Defined in sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:42
|
|
|
|
This method conforms to the web3-provider-engine interface.
|
|
It is called internally by the ProviderEngine when it is this subproviders
|
|
turn to handle a JSON RPC request.
|
|
|
|
**Parameters:**
|
|
|
|
Name | Type | Description |
|
|
------ | ------ | ------ |
|
|
`payload` | `JSONRPCRequestPayload` | JSON RPC payload |
|
|
`next` | [NextCallback](#nextcallback) | Callback to call if this subprovider decides not to handle the request |
|
|
`_end` | [ErrorCallback](#errorcallback) | Callback to call if subprovider handled the request and wants to pass back the request. |
|
|
|
|
**Returns:** *`Promise<void>`*
|
|
|
|
___
|
|
|
|
### setEngine
|
|
|
|
▸ **setEngine**(`engine`: `Web3ProviderEngine`): *void*
|
|
|
|
|
|
|
|
*Overrides void*
|
|
|
|
Defined in sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:49
|
|
|
|
Set's the subprovider's engine to the ProviderEngine it is added to.
|
|
This is only called within the ProviderEngine source code, do not call
|
|
directly.
|
|
|
|
**Parameters:**
|
|
|
|
Name | Type | Description |
|
|
------ | ------ | ------ |
|
|
`engine` | `Web3ProviderEngine` | The ProviderEngine this subprovider is added to |
|
|
|
|
**Returns:** *void*
|
|
|
|
___
|
|
|
|
### start
|
|
|
|
▸ **start**(): *void*
|
|
|
|
|
|
|
|
Defined in sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:29
|
|
|
|
Starts trace collection
|
|
|
|
**Returns:** *void*
|
|
|
|
___
|
|
|
|
### stop
|
|
|
|
▸ **stop**(): *void*
|
|
|
|
|
|
|
|
Defined in sol-tracing-utils/lib/src/trace_collection_subprovider.d.ts:33
|
|
|
|
Stops trace collection
|
|
|
|
**Returns:** *void*
|
|
|
|
___
|
|
|
|
### writeCoverageAsync
|
|
|
|
▸ **writeCoverageAsync**(): *`Promise<void>`*
|
|
|
|
*Defined in [sol-coverage/src/coverage_subprovider.ts:78](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/sol-coverage/src/coverage_subprovider.ts#L78)*
|
|
|
|
Write the test coverage results to a file in Istanbul format.
|
|
|
|
**Returns:** *`Promise<void>`*
|
|
|
|
<hr />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Interface: JSONRPCRequestPayloadWithMethod
|
|
|
|
|
|
## Properties
|
|
|
|
### id
|
|
|
|
• **id**: *number*
|
|
|
|
|
|
|
|
Defined in ethereum-types/lib/index.d.ts:268
|
|
|
|
___
|
|
|
|
### jsonrpc
|
|
|
|
• **jsonrpc**: *string*
|
|
|
|
|
|
|
|
Defined in ethereum-types/lib/index.d.ts:269
|
|
|
|
___
|
|
|
|
### method
|
|
|
|
• **method**: *string*
|
|
|
|
*Overrides void*
|
|
|
|
*Defined in [subproviders/src/types.ts:136](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/subproviders/src/types.ts#L136)*
|
|
|
|
___
|
|
|
|
### params
|
|
|
|
• **params**: *any[]*
|
|
|
|
|
|
|
|
Defined in ethereum-types/lib/index.d.ts:266
|
|
|
|
<hr />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Type aliases
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Type aliases
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Type aliases
|
|
|
|
### CoverageSubproviderPartialConfig
|
|
|
|
Ƭ **CoverageSubproviderPartialConfig**: *`Partial<CoverageSubproviderConfig>`*
|
|
|
|
*Defined in [sol-coverage/src/coverage_subprovider.ts:31](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/sol-coverage/src/coverage_subprovider.ts#L31)*
|
|
|
|
## Object literals
|
|
|
|
### `Const` DEFAULT_COVERAGE_SUBPROVIDER_CONFIG
|
|
|
|
#### ▪ **DEFAULT_COVERAGE_SUBPROVIDER_CONFIG**: *object*
|
|
|
|
*Defined in [sol-coverage/src/coverage_subprovider.ts:33](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/sol-coverage/src/coverage_subprovider.ts#L33)*
|
|
|
|
#### ignoreFilesGlobs
|
|
|
|
• **ignoreFilesGlobs**: *never[]* = []
|
|
|
|
*Defined in [sol-coverage/src/coverage_subprovider.ts:35](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/sol-coverage/src/coverage_subprovider.ts#L35)*
|
|
|
|
#### isVerbose
|
|
|
|
• **isVerbose**: *boolean* = true
|
|
|
|
*Defined in [sol-coverage/src/coverage_subprovider.ts:34](https://github.com/0xProject/0x-monorepo/blob/34538f2ce/packages/sol-coverage/src/coverage_subprovider.ts#L34)*
|
|
|
|
<hr />
|
|
|
|
|
|
|
|
<hr />
|
|
|
|
|
|
|
|
<hr />
|
|
|
|
|
|
|
|
<hr />
|
|
|