Skip to content

Commit

Permalink
Assert decimal values are not allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
anxolin committed Feb 15, 2024
1 parent ce4e81a commit 5c027da
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions test/schema.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -741,27 +741,27 @@ describe('Schema v0.12.0', () => {
)
)

// test(
// 'Signer with invalid address',
// _buildAssertInvalidFn(
// validator,
// {
// ...BASE_DOCUMENT,
// metadata: {
// signer: '0xinvalid',
// },
// },
// [
// {
// instancePath: '/metadata/signer',
// keyword: 'pattern',
// message: 'must match pattern "^0x[a-fA-F0-9]{40}$"',
// params: { pattern: '^0x[a-fA-F0-9]{40}$' },
// schemaPath: '#/properties/metadata/properties/signer/pattern',
// },
// ]
// )
// )
test(
"Invalid partner fee: BIPs don't allow decimals",
_buildAssertInvalidFn(
validator,
{
...BASE_DOCUMENT,
metadata: { partnerFee: { bips: 10.5, recipient: ADDRESS } },
},
[
{
instancePath: '/metadata/partnerFee/bips',
keyword: 'type',
message: 'must be integer',
params: {
type: 'integer',
},
schemaPath: '#/properties/metadata/properties/partnerFee/properties/bips/type',
},
]
)
)
})

function _buildAssertValidFn(validator: ValidateFunction, doc: any) {
Expand Down

0 comments on commit 5c027da

Please sign in to comment.