Skip to content

Commit

Permalink
Finalize gateway token test with no charges
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Leonard authored and Robert Leonard committed Feb 20, 2024
1 parent 0ddafb2 commit 479b512
Show file tree
Hide file tree
Showing 13 changed files with 309 additions and 293 deletions.
247 changes: 0 additions & 247 deletions gateway-eth-ts/src/service/GatewayTs.test.ts

This file was deleted.

4 changes: 2 additions & 2 deletions gateway-eth-ts/src/service/GatewayTs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ export class GatewayTs extends GatewayTsInternal<
constructor(
// ethers.js requires a Wallet instead of Signer for the _signTypedData function, until v6
providerOrWallet: Provider | Wallet,
defaultGatewayToken: string,
gatewayTokenContractAddress: string,
options: Options = {}
) {
const gatewayTokenContract = GatewayToken__factory.connect(
defaultGatewayToken,
gatewayTokenContractAddress,
providerOrWallet
);
super(gatewayTokenContract, options);
Expand Down
12 changes: 7 additions & 5 deletions gateway-eth-ts/src/service/GatewayTsForwarder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import { mapObjIndexed, pick } from "ramda";
import { signMetaTxRequest } from "../utils/metatx";
import { Provider } from "@ethersproject/providers";
import { Charge, ChargeType } from "../utils/charge";
import { Charge, ChargeParties, ChargeType } from "../utils/charge";

// This is the default gas limit used by the GatewayTs forwarder
// if not overridden.
Expand Down Expand Up @@ -129,11 +129,12 @@ export class GatewayTsForwarder extends GatewayTsInternal<
async issue(
owner: string,
network: bigint,
expiry?: BigNumberish,
bitmask?: BigNumberish,
expiry: BigNumberish = 0,
bitmask: BigNumberish = 0,
partiesInCharge: ChargeParties,
charge?: Charge
): Promise<PopulatedTransaction> {
const tx = await super.issue(owner, network, expiry, bitmask, charge);
const tx = await super.issue(owner, network, expiry, bitmask, partiesInCharge, charge);

if (charge?.chargeType === ChargeType.ETH) {
tx.value = charge.value;
Expand All @@ -144,10 +145,11 @@ export class GatewayTsForwarder extends GatewayTsInternal<
async refresh(
owner: string,
network: bigint,
partiesInCharge: ChargeParties,
expiry?: number | BigNumber,
charge?: Charge
): Promise<PopulatedTransaction> {
const tx = await super.refresh(owner, network, expiry, charge);
const tx = await super.refresh(owner, network, partiesInCharge, expiry, charge);

if (charge?.chargeType === ChargeType.ETH) {
tx.value = charge.value;
Expand Down
Loading

0 comments on commit 479b512

Please sign in to comment.