Extend from DecodedLogArgs and fix type names
This commit is contained in:
		@@ -6,7 +6,7 @@
 | 
				
			|||||||
// tslint:disable-next-line:no-unused-variable
 | 
					// tslint:disable-next-line:no-unused-variable
 | 
				
			||||||
import { BaseContract } from '@0xproject/base-contract';
 | 
					import { BaseContract } from '@0xproject/base-contract';
 | 
				
			||||||
import { ContractArtifact } from '@0xproject/sol-compiler';
 | 
					import { ContractArtifact } from '@0xproject/sol-compiler';
 | 
				
			||||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, DataItem, MethodAbi, Provider, TxData, TxDataPayable } from '@0xproject/types';
 | 
					import { BlockParam, BlockParamLiteral, CallData, ContractAbi, DataItem, DecodedLogArgs, MethodAbi, Provider, TxData, TxDataPayable } from '@0xproject/types';
 | 
				
			||||||
import { BigNumber, classUtils, logUtils, promisify } from '@0xproject/utils';
 | 
					import { BigNumber, classUtils, logUtils, promisify } from '@0xproject/utils';
 | 
				
			||||||
import { Web3Wrapper } from '@0xproject/web3-wrapper';
 | 
					import { Web3Wrapper } from '@0xproject/web3-wrapper';
 | 
				
			||||||
import * as ethers from 'ethers';
 | 
					import * as ethers from 'ethers';
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
export interface {{name}}ContractEventArgs {
 | 
					export interface {{name}}ContractEventArgs extends DecodedLogArgs {
 | 
				
			||||||
    {{#each inputs}}
 | 
					    {{#each inputs}}
 | 
				
			||||||
    {{name}}: {{#returnType type components}}{{/returnType}};
 | 
					    {{name}}: {{#returnType type components}}{{/returnType}};
 | 
				
			||||||
    {{/each}}
 | 
					    {{/each}}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -20,22 +20,22 @@ import * as _ from 'lodash';
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import { artifacts } from '../artifacts';
 | 
					import { artifacts } from '../artifacts';
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
    EtherTokenDepositEventArgs,
 | 
					    DepositContractEventArgs,
 | 
				
			||||||
    EtherTokenEventArgs,
 | 
					    EtherTokenContractEventArgs,
 | 
				
			||||||
    EtherTokenEvents,
 | 
					    EtherTokenEvents,
 | 
				
			||||||
    EtherTokenWithdrawalEventArgs,
 | 
					    WithdrawalContractEventArgs,
 | 
				
			||||||
} from '../generated_contract_wrappers/ether_token';
 | 
					} from '../generated_contract_wrappers/ether_token';
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
    ExchangeEventArgs,
 | 
					    ExchangeContractEventArgs,
 | 
				
			||||||
    ExchangeEvents,
 | 
					    ExchangeEvents,
 | 
				
			||||||
    ExchangeLogCancelEventArgs,
 | 
					    LogCancelContractEventArgs,
 | 
				
			||||||
    ExchangeLogFillEventArgs,
 | 
					    LogFillContractEventArgs,
 | 
				
			||||||
} from '../generated_contract_wrappers/exchange';
 | 
					} from '../generated_contract_wrappers/exchange';
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
    TokenApprovalEventArgs,
 | 
					    ApprovalContractEventArgs,
 | 
				
			||||||
    TokenEventArgs,
 | 
					    TokenContractEventArgs,
 | 
				
			||||||
    TokenEvents,
 | 
					    TokenEvents,
 | 
				
			||||||
    TokenTransferEventArgs,
 | 
					    TransferContractEventArgs,
 | 
				
			||||||
} from '../generated_contract_wrappers/token';
 | 
					} from '../generated_contract_wrappers/token';
 | 
				
			||||||
import { OnOrderStateChangeCallback, OrderWatcherConfig, OrderWatcherError } from '../types';
 | 
					import { OnOrderStateChangeCallback, OrderWatcherConfig, OrderWatcherError } from '../types';
 | 
				
			||||||
import { assert } from '../utils/assert';
 | 
					import { assert } from '../utils/assert';
 | 
				
			||||||
@@ -43,7 +43,7 @@ import { assert } from '../utils/assert';
 | 
				
			|||||||
import { EventWatcher } from './event_watcher';
 | 
					import { EventWatcher } from './event_watcher';
 | 
				
			||||||
import { ExpirationWatcher } from './expiration_watcher';
 | 
					import { ExpirationWatcher } from './expiration_watcher';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type ContractEventArgs = EtherTokenEventArgs | ExchangeEventArgs | TokenEventArgs;
 | 
					type ContractEventArgs = EtherTokenContractEventArgs | ExchangeContractEventArgs | TokenContractEventArgs;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
interface DependentOrderHashes {
 | 
					interface DependentOrderHashes {
 | 
				
			||||||
    [makerAddress: string]: {
 | 
					    [makerAddress: string]: {
 | 
				
			||||||
@@ -252,7 +252,7 @@ export class OrderWatcher {
 | 
				
			|||||||
        switch (decodedLog.event) {
 | 
					        switch (decodedLog.event) {
 | 
				
			||||||
            case TokenEvents.Approval: {
 | 
					            case TokenEvents.Approval: {
 | 
				
			||||||
                // Invalidate cache
 | 
					                // Invalidate cache
 | 
				
			||||||
                const args = decodedLog.args as TokenApprovalEventArgs;
 | 
					                const args = decodedLog.args as ApprovalContractEventArgs;
 | 
				
			||||||
                this._balanceAndProxyAllowanceLazyStore.deleteProxyAllowance(decodedLog.address, args._owner);
 | 
					                this._balanceAndProxyAllowanceLazyStore.deleteProxyAllowance(decodedLog.address, args._owner);
 | 
				
			||||||
                // Revalidate orders
 | 
					                // Revalidate orders
 | 
				
			||||||
                makerToken = decodedLog.address;
 | 
					                makerToken = decodedLog.address;
 | 
				
			||||||
@@ -268,7 +268,7 @@ export class OrderWatcher {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
            case TokenEvents.Transfer: {
 | 
					            case TokenEvents.Transfer: {
 | 
				
			||||||
                // Invalidate cache
 | 
					                // Invalidate cache
 | 
				
			||||||
                const args = decodedLog.args as TokenTransferEventArgs;
 | 
					                const args = decodedLog.args as TransferContractEventArgs;
 | 
				
			||||||
                this._balanceAndProxyAllowanceLazyStore.deleteBalance(decodedLog.address, args._from);
 | 
					                this._balanceAndProxyAllowanceLazyStore.deleteBalance(decodedLog.address, args._from);
 | 
				
			||||||
                this._balanceAndProxyAllowanceLazyStore.deleteBalance(decodedLog.address, args._to);
 | 
					                this._balanceAndProxyAllowanceLazyStore.deleteBalance(decodedLog.address, args._to);
 | 
				
			||||||
                // Revalidate orders
 | 
					                // Revalidate orders
 | 
				
			||||||
@@ -285,7 +285,7 @@ export class OrderWatcher {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
            case EtherTokenEvents.Deposit: {
 | 
					            case EtherTokenEvents.Deposit: {
 | 
				
			||||||
                // Invalidate cache
 | 
					                // Invalidate cache
 | 
				
			||||||
                const args = decodedLog.args as EtherTokenDepositEventArgs;
 | 
					                const args = decodedLog.args as DepositContractEventArgs;
 | 
				
			||||||
                this._balanceAndProxyAllowanceLazyStore.deleteBalance(decodedLog.address, args._owner);
 | 
					                this._balanceAndProxyAllowanceLazyStore.deleteBalance(decodedLog.address, args._owner);
 | 
				
			||||||
                // Revalidate orders
 | 
					                // Revalidate orders
 | 
				
			||||||
                makerToken = decodedLog.address;
 | 
					                makerToken = decodedLog.address;
 | 
				
			||||||
@@ -301,7 +301,7 @@ export class OrderWatcher {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
            case EtherTokenEvents.Withdrawal: {
 | 
					            case EtherTokenEvents.Withdrawal: {
 | 
				
			||||||
                // Invalidate cache
 | 
					                // Invalidate cache
 | 
				
			||||||
                const args = decodedLog.args as EtherTokenWithdrawalEventArgs;
 | 
					                const args = decodedLog.args as WithdrawalContractEventArgs;
 | 
				
			||||||
                this._balanceAndProxyAllowanceLazyStore.deleteBalance(decodedLog.address, args._owner);
 | 
					                this._balanceAndProxyAllowanceLazyStore.deleteBalance(decodedLog.address, args._owner);
 | 
				
			||||||
                // Revalidate orders
 | 
					                // Revalidate orders
 | 
				
			||||||
                makerToken = decodedLog.address;
 | 
					                makerToken = decodedLog.address;
 | 
				
			||||||
@@ -317,7 +317,7 @@ export class OrderWatcher {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
            case ExchangeEvents.LogFill: {
 | 
					            case ExchangeEvents.LogFill: {
 | 
				
			||||||
                // Invalidate cache
 | 
					                // Invalidate cache
 | 
				
			||||||
                const args = decodedLog.args as ExchangeLogFillEventArgs;
 | 
					                const args = decodedLog.args as LogFillContractEventArgs;
 | 
				
			||||||
                this._orderFilledCancelledLazyStore.deleteFilledTakerAmount(args.orderHash);
 | 
					                this._orderFilledCancelledLazyStore.deleteFilledTakerAmount(args.orderHash);
 | 
				
			||||||
                // Revalidate orders
 | 
					                // Revalidate orders
 | 
				
			||||||
                const orderHash = args.orderHash;
 | 
					                const orderHash = args.orderHash;
 | 
				
			||||||
@@ -329,7 +329,7 @@ export class OrderWatcher {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
            case ExchangeEvents.LogCancel: {
 | 
					            case ExchangeEvents.LogCancel: {
 | 
				
			||||||
                // Invalidate cache
 | 
					                // Invalidate cache
 | 
				
			||||||
                const args = decodedLog.args as ExchangeLogCancelEventArgs;
 | 
					                const args = decodedLog.args as LogCancelContractEventArgs;
 | 
				
			||||||
                this._orderFilledCancelledLazyStore.deleteCancelledTakerAmount(args.orderHash);
 | 
					                this._orderFilledCancelledLazyStore.deleteCancelledTakerAmount(args.orderHash);
 | 
				
			||||||
                // Revalidate orders
 | 
					                // Revalidate orders
 | 
				
			||||||
                const orderHash = args.orderHash;
 | 
					                const orderHash = args.orderHash;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user