Skip to content

Commit 4c55afa

Browse files
committed
fix: rename keyauth prehash
1 parent de48b86 commit 4c55afa

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"ox": minor
3+
---
4+
5+
**Breaking:** Renamed `prehash` to `preHash` on `KeyAuthorization#P256Rpc`

src/tempo/SignatureEnvelope.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1907,7 +1907,7 @@ describe('fromRpc', () => {
19071907
describe('p256', () => {
19081908
test('behavior: converts RPC P256 signature', () => {
19091909
const rpc: SignatureEnvelope.P256Rpc = {
1910-
prehash: true,
1910+
preHash: true,
19111911
pubKeyX: Hex.fromNumber(publicKey.x, { size: 32 }),
19121912
pubKeyY: Hex.fromNumber(publicKey.y, { size: 32 }),
19131913
r: Hex.fromNumber(p256Signature.r, { size: 32 }),
@@ -2005,7 +2005,7 @@ describe('fromRpc', () => {
20052005
type: 'keychain',
20062006
userAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcd',
20072007
signature: {
2008-
prehash: true,
2008+
preHash: true,
20092009
pubKeyX: Hex.fromNumber(publicKey.x, { size: 32 }),
20102010
pubKeyY: Hex.fromNumber(publicKey.y, { size: 32 }),
20112011
r: Hex.fromNumber(p256Signature.r, { size: 32 }),
@@ -2108,7 +2108,7 @@ describe('toRpc', () => {
21082108
const rpc = SignatureEnvelope.toRpc(signature_p256)
21092109

21102110
expect(rpc.type).toBe('p256')
2111-
expect(rpc.prehash).toBe(true)
2111+
expect(rpc.preHash).toBe(true)
21122112
expect(typeof rpc.pubKeyX).toBe('string')
21132113
expect(typeof rpc.pubKeyY).toBe('string')
21142114
expect(typeof rpc.r).toBe('string')
@@ -2119,7 +2119,7 @@ describe('toRpc', () => {
21192119
const withPrehashFalse = { ...signature_p256, prehash: false }
21202120
const rpc = SignatureEnvelope.toRpc(withPrehashFalse)
21212121

2122-
expect(rpc.prehash).toBe(false)
2122+
expect(rpc.preHash).toBe(false)
21232123
})
21242124
})
21252125

src/tempo/SignatureEnvelope.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export type P256<bigintType = bigint, numberType = number> = {
128128
}
129129

130130
export type P256Rpc = {
131-
prehash: boolean
131+
preHash: boolean
132132
pubKeyX: Hex.Hex
133133
pubKeyY: Hex.Hex
134134
r: Hex.Hex
@@ -597,7 +597,7 @@ export function fromRpc(envelope: SignatureEnvelopeRpc): SignatureEnvelope {
597597

598598
if (envelope.type === 'p256') {
599599
return {
600-
prehash: envelope.prehash,
600+
prehash: envelope.preHash,
601601
publicKey: {
602602
prefix: 4,
603603
x: Hex.toBigInt(envelope.pubKeyX),
@@ -874,7 +874,7 @@ export function toRpc(envelope: SignatureEnvelope): SignatureEnvelopeRpc {
874874
if (type === 'p256') {
875875
const p256 = envelope as P256
876876
return {
877-
prehash: p256.prehash,
877+
preHash: p256.prehash,
878878
pubKeyX: Hex.fromNumber(p256.publicKey.x, { size: 32 }),
879879
pubKeyY: Hex.fromNumber(p256.publicKey.y, { size: 32 }),
880880
r: Hex.fromNumber(p256.signature.r, { size: 32 }),

0 commit comments

Comments
 (0)