Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format schema with list of objects doesn't work #6777

Closed
avkos opened this issue Jan 30, 2024 · 0 comments · Fixed by #7040
Closed

Format schema with list of objects doesn't work #6777

avkos opened this issue Jan 30, 2024 · 0 comments · Fixed by #7040
Assignees
Labels
4.x 4.0 related Bug Addressing a bug

Comments

@avkos
Copy link
Contributor

avkos commented Jan 30, 2024

Expected behavior

Should return formatted data:

// [{ a:1n }, { a:2n }, { a:3n }]

Actual behavior

// [undefined, undefined, undefined]

Steps to reproduce the behavior

import { format } from 'web3-utils';

const schema={
  type: 'array',
  items: {
    type: 'object',
    properties: {
      a: { format: 'uint' },
    },
  },
}
const data = [{ a: 1 }, { a: 2 }, { a: 3 }]

format(schema,data) // [undefined, undefined, undefined]

Logs

Environment

@avkos avkos added Bug Addressing a bug 4.x 4.0 related labels Jan 30, 2024
@avkos avkos self-assigned this May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x 4.0 related Bug Addressing a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant