Skip to content

Commit

Permalink
Fixed Contract and Interface constructor abi paramter type; should be…
Browse files Browse the repository at this point in the history
… a Fragment not a ParamType (#602).
  • Loading branch information
ricmoo committed Jan 11, 2020
1 parent 26d3271 commit 6da5c53
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src.ts/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { Signer } from './abstract-signer';

import { Arrayish } from './utils/bytes';
import { EventDescription } from './utils/interface';
import { ParamType } from './utils/abi-coder';
import { EventFragment, FunctionFragment, ParamType } from './utils/abi-coder';
import { Block, Listener, Log, TransactionReceipt, TransactionRequest, TransactionResponse } from './providers/abstract-provider';

///////////////////////////////
Expand Down Expand Up @@ -364,7 +364,7 @@ export class Contract {
// Once this issue is resolved (there are open PR) we can do this nicer
// by making addressOrName default to null for 2 operand calls. :)

constructor(addressOrName: string, contractInterface: Array<string | ParamType> | string | Interface, signerOrProvider: Signer | Provider) {
constructor(addressOrName: string, contractInterface: Array<string | FunctionFragment | EventFragment> | string | Interface, signerOrProvider: Signer | Provider) {
errors.checkNew(this, Contract);

// @TODO: Maybe still check the addressOrName looks like a valid address or name?
Expand Down Expand Up @@ -744,7 +744,7 @@ export class ContractFactory {
readonly bytecode: string;
readonly signer: Signer;

constructor(contractInterface: Array<string | ParamType> | string | Interface, bytecode: Arrayish | string | { object: string }, signer?: Signer) {
constructor(contractInterface: Array<string | FunctionFragment | EventFragment> | string | Interface, bytecode: Arrayish | string | { object: string }, signer?: Signer) {

let bytecodeHex: string = null;

Expand Down
2 changes: 1 addition & 1 deletion src.ts/utils/abi-coder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export type FunctionFragment = {
payable: boolean,
stateMutability: string,

gas: BigNumber
gas?: BigNumber
};

///////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion src.ts/utils/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ export class Interface {
readonly events: { [ name: string ]: _EventDescription };
readonly deployFunction: _DeployDescription;

constructor(abi: Array<string | ParamType> | string) {
constructor(abi: Array<string | FunctionFragment | EventFragment> | string) {
errors.checkNew(this, Interface);

if (typeof(abi) === 'string') {
Expand Down

0 comments on commit 6da5c53

Please sign in to comment.