Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeder committed Jun 19, 2024
1 parent 683bd9c commit a1dde0d
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions test/test/schema-encoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,45 @@ describe('SchemaEncoder', () => {
]
}
]
},
{
schema: '(uint256 badgeId,uint256 level)[] badges',
types: ['(uint256 badgeId,uint256 level)[]'],
inputs: [
{
in: [
{
type: '(uint256,uint256)[]',
name: 'badges',
value: [
{ badgeId: 1n, level: 10n },
{ badgeId: 2n, level: 20n },
{ badgeId: 3n, level: 30n }
]
}
],
out: [
{
type: '(uint256,uint256)[]',
name: 'badges',
value: [
[
{ name: 'badgeId', type: 'uint256', value: 1n },
{ name: 'level', type: 'uint256', value: 10n }
],
[
{ name: 'badgeId', type: 'uint256', value: 2n },
{ name: 'level', type: 'uint256', value: 20n }
],
[
{ name: 'badgeId', type: 'uint256', value: 3n },
{ name: 'level', type: 'uint256', value: 30n }
]
]
}
]
}
]
}
]) {
for (const params of inputs) {
Expand Down

0 comments on commit a1dde0d

Please sign in to comment.