|
1 | 1 | import { SBool } from "@fleet-sdk/serializer"; |
2 | 2 | import { regularBoxes } from "_test-vectors"; |
3 | | -import { describe, expect, it } from "vitest"; |
| 3 | +import { ErgoBox } from "packages/core/dist"; |
| 4 | +import { describe, expect, it, test } from "vitest"; |
4 | 5 | import { ErgoUnsignedInput } from "./ergoUnsignedInput"; |
5 | 6 |
|
6 | 7 | describe("Construction", () => { |
7 | | - it("Should construct from a vanilla object", () => { |
8 | | - for (const box of regularBoxes) { |
9 | | - const input = new ErgoUnsignedInput(box); |
| 8 | + test.each(regularBoxes)("Should construct from a vanilla object", (box) => { |
| 9 | + const input = new ErgoUnsignedInput(box); |
10 | 10 |
|
11 | | - expect(input.boxId).toBe(box.boxId); |
12 | | - expect(input.value).toBe(box.value); |
13 | | - expect(input.ergoTree).toBe(box.ergoTree); |
14 | | - expect(input.assets).toEqual(box.assets); |
15 | | - expect(input.creationHeight).toBe(box.creationHeight); |
16 | | - expect(input.additionalRegisters).toBe(box.additionalRegisters); |
17 | | - expect(input.transactionId).toBe(box.transactionId); |
18 | | - expect(input.index).toBe(box.index); |
19 | | - expect(input.extension).to.be.deep.equal({}); |
20 | | - } |
| 11 | + expect(input.boxId).toBe(box.boxId); |
| 12 | + expect(input.value).toBe(box.value); |
| 13 | + expect(input.ergoTree).toBe(box.ergoTree); |
| 14 | + expect(input.assets).toEqual(box.assets); |
| 15 | + expect(input.creationHeight).toBe(box.creationHeight); |
| 16 | + expect(input.additionalRegisters).toBe(box.additionalRegisters); |
| 17 | + expect(input.transactionId).toBe(box.transactionId); |
| 18 | + expect(input.index).toBe(box.index); |
| 19 | + expect(input.extension).to.be.deep.equal({}); |
| 20 | + }); |
| 21 | + |
| 22 | + test.each(regularBoxes)("Should construct from a ErgoBox object", (box) => { |
| 23 | + const input = new ErgoUnsignedInput(new ErgoBox(box)); |
| 24 | + |
| 25 | + expect(input.boxId).toBe(box.boxId); |
| 26 | + expect(input.value).toBe(box.value); |
| 27 | + expect(input.ergoTree).toBe(box.ergoTree); |
| 28 | + expect(input.assets).toEqual(box.assets); |
| 29 | + expect(input.creationHeight).toBe(box.creationHeight); |
| 30 | + expect(input.additionalRegisters).toBe(box.additionalRegisters); |
| 31 | + expect(input.transactionId).toBe(box.transactionId); |
| 32 | + expect(input.index).toBe(box.index); |
| 33 | + expect(input.extension).to.be.deep.equal({}); |
21 | 34 | }); |
22 | 35 | }); |
23 | 36 |
|
|
0 commit comments