Skip to content

Commit

Permalink
Fixes tests
Browse files Browse the repository at this point in the history
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
  • Loading branch information
konstantinabl committed Aug 29, 2023
1 parent 0d90b4c commit 8bf231c
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
24 changes: 20 additions & 4 deletions docs/openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -1159,8 +1159,7 @@
},
"accessList": {
"title": "accessList",
"description": "not supported",
"$ref": "#/components/schemas/null"
"type" : "array"
},
"chainId": {
"title": "chainId",
Expand Down Expand Up @@ -1235,7 +1234,15 @@
"yParity": {
"title": "yParity",
"description": "The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.",
"$ref": "#/components/schemas/uint"
"oneOf": [
{
"$ref": "#/components/schemas/byte"
},
{
"$ref": "#/components/schemas/null"
}
]

},
"r": {
"title": "r",
Expand Down Expand Up @@ -1276,7 +1283,16 @@
"properties": {
"v": {
"title": "v",
"$ref": "#/components/schemas/uint"
"oneOf": [
{
"$ref": "#/components/schemas/uint"
},
{
"$ref": "#/components/schemas/null"
}
]


},
"r": {
"title": "r",
Expand Down
6 changes: 5 additions & 1 deletion packages/relay/tests/assertions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ export default class RelayAssertions {
expect(tx.to).to.eq(expectedTx.to);
expect(tx.transactionIndex).to.eq(expectedTx.transactionIndex);
expect(tx.type).to.eq(numberTo0x(expectedTx.type));
expect(tx.v).to.eq(numberTo0x(expectedTx.v));
if(tx.type === "0x1" || tx.type === "0x2") {
expect(tx.yParity).to.eq(numberTo0x(expectedTx.v));
} else {
expect(tx.v).to.eq(numberTo0x(expectedTx.v));
}
expect(tx.value).to.eq(expectedTx.value);
};

Expand Down
3 changes: 2 additions & 1 deletion packages/relay/tests/lib/eth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5171,7 +5171,8 @@ describe('Eth', async function () {
it('handles transactions with v as null', async function () {
const detailedResultsWithNullNullableValues = {
...defaultDetailedContractResultByHash,
v: null
v: null,
type: 0
};
const uniqueTxHash = '0xb4cad7b827375d12d73af57b6a3e84353645fd31305ea58ff52dda53ec640533';

Expand Down
6 changes: 4 additions & 2 deletions packages/relay/tests/lib/formatters.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ describe('Formatters', () => {
expect(formattedResult.to).to.equal('0x0000000000000000000000000000000000000409');
expect(formattedResult.transactionIndex).to.equal('0x9');
expect(formattedResult.type).to.equal('0x2');
expect(formattedResult.v).to.equal('0x1');
expect(formattedResult.yParity).to.equal('0x1');
expect(formattedResult.v).to.equal(undefined);
expect(formattedResult.value).to.equal('0x0');
});

Expand Down Expand Up @@ -251,7 +252,8 @@ describe('Formatters', () => {
expect(formattedResult.s).to.equal(null);
expect(formattedResult.to).to.equal('0x0000000000000000000000000000000000000409');
expect(formattedResult.transactionIndex).to.equal(null);
expect(formattedResult.v).to.equal('0x0');
expect(formattedResult.v).to.equal(undefined);
expect(formattedResult.yParity).to.equal('0x0');
expect(formattedResult.value).to.equal('0x0');
});
});
Expand Down

0 comments on commit 8bf231c

Please sign in to comment.