Skip to content

Commit

Permalink
fix returning counter as string (#175)
Browse files Browse the repository at this point in the history
* return counter toString

* bump version to 1.0.10

* fix tests

* fix test

---------

Co-authored-by: Adam Montgomery <[email protected]>
  • Loading branch information
ryanio and montasaurus authored Mar 2, 2023
1 parent 26aa66b commit a4ceed5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
3 changes: 1 addition & 2 deletions src/__tests__/create-bulk-orders.spec.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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,
});
Expand Down
9 changes: 4 additions & 5 deletions src/__tests__/create-order.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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,
});
Expand Down Expand Up @@ -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,
});
Expand Down Expand Up @@ -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,
});
Expand Down Expand Up @@ -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,
});
Expand Down
2 changes: 1 addition & 1 deletion src/seaport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [];
Expand Down

0 comments on commit a4ceed5

Please sign in to comment.