Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
Add rfq w/ private data omitted test vector
Browse files Browse the repository at this point in the history
  • Loading branch information
KendallWeihe committed Sep 29, 2024
1 parent e591c4e commit 8092cc5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions bound/typescript/tests/test-vectors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { expect } from "chai";
import OfferingVector from "../../../tbdex/hosted/test-vectors/protocol/vectors/parse-offering.json" assert { type: "json" };
import BalanceVector from "../../../tbdex/hosted/test-vectors/protocol/vectors/parse-balance.json" assert { type: "json" };
import RfqVector from "../../../tbdex/hosted/test-vectors/protocol/vectors/parse-rfq.json" assert { type: "json" };
import RfqOmitPrivateDataVector from "../../../tbdex/hosted/test-vectors/protocol/vectors/parse-rfq-omit-private-data.json" assert { type: "json" };
import QuoteVector from "../../../tbdex/hosted/test-vectors/protocol/vectors/parse-quote.json" assert { type: "json" };
import OrderVector from "../../../tbdex/hosted/test-vectors/protocol/vectors/parse-order.json" assert { type: "json" };
import CancelVector from "../../../tbdex/hosted/test-vectors/protocol/vectors/parse-cancel.json" assert { type: "json" };
Expand Down Expand Up @@ -99,6 +100,22 @@ describe("test vectors", () => {
rfq.verify();
});

it("should parse with private data omitted", () => {
const input = RfqOmitPrivateDataVector.input;
const rfq = Rfq.fromJSONString(input);
expect(rfq.metadata).to.deep.equal(
RfqOmitPrivateDataVector.output.metadata
);
expect(rfq.data).to.deep.equal(RfqOmitPrivateDataVector.output.data);
expect(rfq.signature).to.equal(RfqOmitPrivateDataVector.output.signature);

const rfqJSONString = rfq.toJSONString();
const rfqJSON = JSON.parse(rfqJSONString);
expect(rfqJSON).to.deep.equal(RfqOmitPrivateDataVector.output);

rfq.verify();
});

it("should create, sign, and verify", () => {
const createRfqData: CreateRfqData = {
claims: RfqVector.output.privateData.claims,
Expand Down

0 comments on commit 8092cc5

Please sign in to comment.