Skip to content

Commit

Permalink
fix(cu): coerce blockHeight to a number #262
Browse files Browse the repository at this point in the history
  • Loading branch information
TillaTheHun0 committed Jan 2, 2024
1 parent 622546c commit b2c436a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion servers/cu/src/domain/client/ao-su.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,15 @@ export const loadMessagesWith = ({ fetch, logger: _logger, pageSize }) => {
Epoch: path(['epoch']),
Nonce: path(['nonce']),
Timestamp: path(['timestamp']),
'Block-Height': path(['block']),
'Block-Height': pipe(
/**
* Returns a left padded integer like '000001331218'
*
* So use parseInt to convert it into a number
*/
path(['block']),
(str) => parseInt(`${str}`)
),
'Hash-Chain': path(['hash_chain']),
Cron: always(false)
}),
Expand Down
2 changes: 1 addition & 1 deletion servers/cu/src/domain/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export const evaluationSchema = z.object({
messageId: z.string().min(1).optional(),
timestamp: z.coerce.number(),
ordinate: z.coerce.string(),
blockHeight: z.number(),
blockHeight: z.coerce.number(),
/**
* Scheduled messages do not have a cron
*/
Expand Down

0 comments on commit b2c436a

Please sign in to comment.