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

Commit

Permalink
Update tbdex to latest main and move compiled-validators to cjs
Browse files Browse the repository at this point in the history
  • Loading branch information
Diane Huxley committed Mar 26, 2024
1 parent 80da7b6 commit fceb7ac
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion packages/http-server/tests/create-exchange.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ describe('POST /exchanges/:exchangeId/rfq', () => {
},
required : ['btcAddress'],
additionalProperties : false
}
},
estimatedSettlementTime: 10,
}]
},
},
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/build/compile-validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ const moduleCode = standaloneCode(validator)
const __dirname = url.fileURLToPath(new URL('.', import.meta.url))

await mkdirp(path.join(__dirname, '../generated'))
fs.writeFileSync(path.join(__dirname, '../generated/compiled-validators.js'), moduleCode)
fs.writeFileSync(path.join(__dirname, '../generated/compiled-validators.cjs'), moduleCode)
2 changes: 1 addition & 1 deletion packages/protocol/src/validator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ErrorObject } from 'ajv'
// validator functions are compiled at build time. check ./build/compile-validators.js for more details
import * as compiledValidators from '../generated/compiled-validators.js'
import * as compiledValidators from '../generated/compiled-validators.cjs'

/**
* validates the payload against a json schema identified by name
Expand Down
6 changes: 3 additions & 3 deletions packages/protocol/tests/test-vectors.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import ParseRfq from '../../../tbdex/hosted/test-vectors/protocol/vectors/parse-
import { Close, Offering, Order, OrderStatus, Quote, Rfq } from '../src/main.js'
import { Parser } from '../src/parser.js'

describe.skip('TbdexTestVectorsProtocol', function () {
describe('TbdexTestVectorsProtocol', function () {
this.timeout(10000)
it('parse_close', async () => {
// Parse with parseMessage()
Expand All @@ -22,7 +22,7 @@ describe.skip('TbdexTestVectorsProtocol', function () {
expect(close.toJSON()).to.deep.eq(ParseClose.output)
})

it('parse_offering', async() => {
it.skip('parse_offering', async() => {
// Parse with parseResource()
const resource = await Parser.parseResource(ParseOffering.input)
expect(resource.isOffering()).to.be.true
Expand Down Expand Up @@ -70,7 +70,7 @@ describe.skip('TbdexTestVectorsProtocol', function () {
expect(quote.toJSON()).to.deep.eq(ParseQuote.output)
})

it('parse_rfq', async () => {
it.skip('parse_rfq', async () => {
// Parse with parseMessage()
const message = await Parser.parseMessage(ParseRfq.input)
expect(message.isRfq()).to.be.true
Expand Down

0 comments on commit fceb7ac

Please sign in to comment.