Closed fermentfan closed 9 months ago
@mirceanis I have a hard time finding out whether these test results are really showing an error in the system. The generated signatures mismatch from the expected ones, but maybe that is ok as the content changed with the bigint usage?
These are the only tests currently failing. Now waiting for release of ethr-did-resolver and ethr-did.
I merge next into the branch and switched to the official releases of the 'ethr-did-resolver' & 'ethr-did'. Ready for review!
I figured out why the tests are failing there.
ethers infers the transaction type when serializing it. v6 does the inference a little differently and ends up serializing transactions that specify a gasPrice as type 1 where v5 would infer type 0.
Both transaction forms would be accepted by the EVM so it is ok to update the test vectors with the new values.
For completeness, we should also have a test that sets the transaction type to 0 and compares with the previous test vectors:
it('should sign EthTX using generic signer and specific type', async () => {
const transaction = Transaction.from({
to: '0xcE31a19193D4b23F4E9D6163d7247243BAF801C3',
value: 300000,
gasLimit: 43092000,
gasPrice: 20000000000,
nonce: 1,
type: 0, // enforce legacy serialization
})
const txData = transaction.unsignedSerialized
const rawTx = await agent.keyManagerSign({
algorithm: 'eth_signTransaction',
data: txData,
encoding: 'hex',
keyRef: importedKey.kid,
})
expect(rawTx).toEqual(
'0xf869018504a817c800840291882094ce31a19193d4b23f4e9d6163d7247243baf801c3830493e0801ba0f16e2206290181c3feaa04051dad19089105c24339dbdf0d80147b48a59fa152a0770e8751ec77ccc78e8b207023f168444f7cfb67055c55c70ef75234458a3d51',
)
})
Ahh thanks for spotting that. Amazing! I pushed the changes including the new test now. Let's see what the CI/CD says. At least on my local machine everything is green
Attention: 26 lines
in your changes are missing coverage. Please review.
Comparison is base (
93198bc
) 84.99% compared to head (a6a796f
) 84.91%. Report is 1 commits behind head on next.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Still have to fix tests...