From a4ceed5b49cc020be647954892884517e2d237fa Mon Sep 17 00:00:00 2001 From: Ryan Ghods Date: Wed, 1 Mar 2023 18:57:09 -0800 Subject: [PATCH] fix returning counter as string (#175) * return counter toString * bump version to 1.0.10 * fix tests * fix test --------- Co-authored-by: Adam Montgomery --- package.json | 2 +- src/__tests__/create-bulk-orders.spec.ts | 3 +-- src/__tests__/create-order.spec.ts | 9 ++++----- src/seaport.ts | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 0702e375..6eca444f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@opensea/seaport-js", - "version": "1.0.9", + "version": "1.0.10", "description": "[Seaport](https://github.com/ProjectOpenSea/seaport) is a new marketplace protocol for safely and efficiently buying and selling NFTs. This is a JavaScript library intended to make interfacing with the contract reasonable and easy.", "license": "MIT", "author": "OpenSea Developers", diff --git a/src/__tests__/create-bulk-orders.spec.ts b/src/__tests__/create-bulk-orders.spec.ts index 137c3a51..972e2c1d 100644 --- a/src/__tests__/create-bulk-orders.spec.ts +++ b/src/__tests__/create-bulk-orders.spec.ts @@ -1,5 +1,4 @@ import { expect } from "chai"; -import { BigNumber } from "ethers"; import { ethers } from "hardhat"; import { ItemType, MAX_INT, NO_CONDUIT, OrderType } from "../constants"; import { @@ -129,7 +128,7 @@ describeWithFixture( zone: ethers.constants.AddressZero, zoneHash: ethers.constants.HashZero, conduitKey: NO_CONDUIT, - counter: BigNumber.from(0), + counter: "0", }, signature: order.signature, }); diff --git a/src/__tests__/create-order.spec.ts b/src/__tests__/create-order.spec.ts index bd4b257f..2c7a5fda 100644 --- a/src/__tests__/create-order.spec.ts +++ b/src/__tests__/create-order.spec.ts @@ -6,7 +6,6 @@ import { ItemType, MAX_INT, NO_CONDUIT, OrderType } from "../constants"; import { ApprovalAction, CreateOrderAction } from "../types"; import { generateRandomSalt } from "../utils/order"; import { describeWithFixture } from "./utils/setup"; -import { BigNumber } from "ethers"; describeWithFixture("As a user I want to create an order", (fixture) => { it("should create the order after setting needed approvals", async () => { @@ -104,7 +103,7 @@ describeWithFixture("As a user I want to create an order", (fixture) => { zone: ethers.constants.AddressZero, zoneHash: ethers.constants.HashZero, conduitKey: NO_CONDUIT, - counter: BigNumber.from(0), + counter: "0", }, signature: order.signature, }); @@ -219,7 +218,7 @@ describeWithFixture("As a user I want to create an order", (fixture) => { zone: ethers.constants.AddressZero, zoneHash: ethers.constants.HashZero, conduitKey: NO_CONDUIT, - counter: BigNumber.from(0), + counter: "0", }, signature: order.signature, }); @@ -383,7 +382,7 @@ describeWithFixture("As a user I want to create an order", (fixture) => { zone: ethers.constants.AddressZero, zoneHash: ethers.constants.HashZero, conduitKey: NO_CONDUIT, - counter: BigNumber.from(0), + counter: "0", }, signature: order.signature, }); @@ -595,7 +594,7 @@ describeWithFixture("As a user I want to create an order", (fixture) => { zone: ethers.constants.AddressZero, zoneHash: ethers.constants.HashZero, conduitKey: NO_CONDUIT, - counter: BigNumber.from(0), + counter: "0", }, signature: order.signature, }); diff --git a/src/seaport.ts b/src/seaport.ts index 3f0fadb1..5a1afce3 100644 --- a/src/seaport.ts +++ b/src/seaport.ts @@ -378,7 +378,7 @@ export class Seaport { totalOriginalConsiderationItems: considerationItemsWithFees.length, salt: saltFollowingConditional, conduitKey, - counter: counter ?? (await this.getCounter(offerer)), + counter: (counter ?? (await this.getCounter(offerer))).toString(), }; const approvalActions: ApprovalAction[] = [];