Skip to content

Commit a732ddb

Browse files
DefiCakeluizstacio
andauthored
Fix ECDSA test flakiness (#144)
Co-authored-by: Luiz Estácio | stacio.eth <luizstacio@gmail.com>
1 parent 3587c5c commit a732ddb

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/good-clocks-check.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@fuel-bridge/solidity-contracts': minor
3+
---
4+
5+
Fix ECDSA test flakiness

packages/solidity-contracts/protocol/validators.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { SigningKey } from 'ethers';
2-
import { toBeArray } from 'ethers';
2+
import { zeroPadValue } from 'ethers';
33

4-
// Sign a messag with a signer, returning the signature object (v, r, s components)
4+
// Sign a message with a signer, returning the signature object (v, r, s components)
55
export function componentSign(signer: SigningKey, message: string) {
6-
return signer.sign(toBeArray(message));
6+
return signer.sign(zeroPadValue(message, 32));
77
}
88

99
// Sign a message with as signer, returning a 64-byte compact ECDSA signature

0 commit comments

Comments
 (0)