Add ethereum-types to extraFileIncludes

This commit is contained in:
Leonid Logvinov
2018-05-31 10:14:23 -07:00
parent a7fc9caacb
commit fa3d011f68
8 changed files with 22 additions and 8 deletions

View File

@@ -44,6 +44,7 @@
"docPublishConfigs": {
"extraFileIncludes": [
"../types/src/index.ts",
"../ethereum-types/src/index.ts",
"../contract-wrappers/src/types.ts",
"../contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts",
"../contract-wrappers/src/contract_wrappers/exchange_wrapper.ts",

View File

@@ -1,7 +1,14 @@
import { ContractArtifact } from '@0xproject/sol-compiler';
import { AbiDecoder, BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import { AbiDefinition, LogEntry, LogWithDecodedArgs, RawLog, TransactionReceiptWithDecodedLogs } from 'ethereum-types';
import {
AbiDefinition,
DecodedLogArgs,
LogEntry,
LogWithDecodedArgs,
RawLog,
TransactionReceiptWithDecodedLogs,
} from 'ethereum-types';
import * as _ from 'lodash';
import { artifacts } from './artifacts';
@@ -30,7 +37,7 @@ export class LogDecoder {
});
this._abiDecoder = new AbiDecoder(abiArrays);
}
public decodeLogOrThrow<ArgsType>(log: LogEntry): LogWithDecodedArgs<ArgsType> | RawLog {
public decodeLogOrThrow<ArgsType extends DecodedLogArgs>(log: LogEntry): LogWithDecodedArgs<ArgsType> | RawLog {
const logWithDecodedArgsOrLog = this._abiDecoder.tryToDecodeLogOrNoop(log);
if (_.isUndefined((logWithDecodedArgsOrLog as LogWithDecodedArgs<ArgsType>).args)) {
throw new Error(`Unable to decode log: ${JSON.stringify(log)}`);

View File

@@ -27,7 +27,8 @@
"assets": [],
"docPublishConfigs": {
"extraFileIncludes": [
"../types/src/index.ts"
"../types/src/index.ts",
"../ethereum-types/src/index.ts"
],
"s3BucketPath": "s3://doc-jsons/json-schemas/",
"s3StagingBucketPath": "s3://staging-doc-jsons/json-schemas/"

View File

@@ -26,7 +26,8 @@
"postpublish": {
"docPublishConfigs": {
"extraFileIncludes": [
"../types/src/index.ts"
"../types/src/index.ts",
"../ethereum-types/src/index.ts"
],
"s3BucketPath": "s3://doc-jsons/order-utils/",
"s3StagingBucketPath": "s3://staging-doc-jsons/order-utils/"

View File

@@ -28,7 +28,8 @@
"assets": [],
"docPublishConfigs": {
"extraFileIncludes": [
"../types/src/index.ts"
"../types/src/index.ts",
"../ethereum-types/src/index.ts"
],
"s3BucketPath": "s3://doc-jsons/sol-compiler/",
"s3StagingBucketPath": "s3://staging-doc-jsons/sol-compiler/"

View File

@@ -29,7 +29,8 @@
"docPublishConfigs": {
"extraFileIncludes": [
"../subproviders/src/types.ts",
"../types/src/index.ts"
"../types/src/index.ts",
"../ethereum-types/src/index.ts"
],
"s3BucketPath": "s3://doc-jsons/sol-cov/",
"s3StagingBucketPath": "s3://staging-doc-jsons/sol-cov/"

View File

@@ -31,7 +31,8 @@
"assets": [],
"docPublishConfigs": {
"extraFileIncludes": [
"../types/src/index.ts"
"../types/src/index.ts",
"../ethereum-types/src/index.ts"
],
"s3BucketPath": "s3://doc-jsons/subproviders/",
"s3StagingBucketPath": "s3://staging-doc-jsons/subproviders/"

View File

@@ -26,7 +26,8 @@
"postpublish": {
"docPublishConfigs": {
"extraFileIncludes": [
"../types/src/index.ts"
"../types/src/index.ts",
"../ethereum-types/src/index.ts"
],
"s3BucketPath": "s3://doc-jsons/web3-wrapper/",
"s3StagingBucketPath": "s3://staging-doc-jsons/web3-wrapper/"