Skip to content

Commit

Permalink
fix: this undefined for fee-proxy-contract (#510)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjlevesque committed May 11, 2021
1 parent 67dd6c7 commit 67898bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/payment-detection/src/erc20/fee-proxy-contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,10 @@ export default class PaymentNetworkERC20FeeProxyContract<
throw new NetworkNotSupported(`Payment network not supported by ERC20 payment detection`);
}

const deploymentInformation = this.getDeploymentInformation(network, paymentNetwork.version);
const deploymentInformation = erc20FeeProxyArtifact.getDeploymentInformation(
network,
paymentNetwork.version,
);

if (!deploymentInformation) {
throw new VersionNotSupported(
Expand Down Expand Up @@ -307,7 +310,4 @@ export default class PaymentNetworkERC20FeeProxyContract<
get paymentNetworkId(): ExtensionTypes.ID {
return this._paymentNetworkId;
}

protected getDeploymentInformation: DeploymentInformationGetter =
erc20FeeProxyArtifact.getDeploymentInformation;
}
9 changes: 8 additions & 1 deletion packages/smart-contracts/src/lib/ContractArtifact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@ export type ArtifactInfo<
* and utilities to connect to it
**/
export class ContractArtifact<TContract extends Contract> {
constructor(private info: ArtifactInfo<string, string>, private lastVersion: string) {}
constructor(private info: ArtifactInfo<string, string>, private lastVersion: string) {
this.connect = this.connect.bind(this);
this.getInterface = this.getInterface.bind(this);
this.getContractAbi = this.getContractAbi.bind(this);
this.getAddress = this.getAddress.bind(this);
this.getCreationBlockNumber = this.getCreationBlockNumber.bind(this);
this.getDeploymentInformation = this.getDeploymentInformation.bind(this);
}

/**
* Returns an ethers contract instance for the given `networkName`
Expand Down

0 comments on commit 67898bb

Please sign in to comment.