Skip to content

Commit

Permalink
remove compat address format from bech32 and types package
Browse files Browse the repository at this point in the history
  • Loading branch information
TalDerei committed Dec 21, 2024
1 parent b6cd1fa commit 28054ef
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 71 deletions.
1 change: 0 additions & 1 deletion packages/bech32m/src/format/bytes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export const ByteLength = {
passet: 32,
pauctid: 32,
penumbra: 80,
penumbracompat1: 80,
penumbrafullviewingkey: 64,
penumbragovern: 32,
penumbraspendkey: 32,
Expand Down
6 changes: 0 additions & 6 deletions packages/bech32m/src/format/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ export default {
byteLength: ByteLength.penumbra,
innerName: Inner.penumbra,
},
penumbracompat1: {
prefix: Prefixes.penumbracompat1,
stringLength: StringLength.penumbracompat1,
byteLength: ByteLength.penumbracompat1,
innerName: Inner.penumbracompat1,
},
penumbrafullviewingkey: {
prefix: Prefixes.penumbrafullviewingkey,
stringLength: StringLength.penumbrafullviewingkey,
Expand Down
1 change: 0 additions & 1 deletion packages/bech32m/src/format/inner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export const Inner = {
passet: 'inner',
pauctid: 'inner',
penumbra: 'inner',
penumbracompat1: 'inner',
penumbrafullviewingkey: 'inner',
penumbragovern: 'gk',
penumbraspendkey: 'inner',
Expand Down
1 change: 0 additions & 1 deletion packages/bech32m/src/format/prefix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export const Prefixes = {
passet: 'passet',
pauctid: 'pauctid',
penumbra: 'penumbra',
penumbracompat1: 'penumbracompat1',
penumbrafullviewingkey: 'penumbrafullviewingkey',
penumbragovern: 'penumbragovern',
penumbraspendkey: 'penumbraspendkey',
Expand Down
1 change: 0 additions & 1 deletion packages/bech32m/src/format/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export const StringLength = {
passet: 65,
pauctid: 66,
penumbra: 143,
penumbracompat1: 150,
penumbrafullviewingkey: 132,
penumbragovern: 73,
penumbraspendkey: 75,
Expand Down
24 changes: 0 additions & 24 deletions packages/bech32m/src/penumbracompat1.ts

This file was deleted.

25 changes: 0 additions & 25 deletions packages/bech32m/src/test/penumbracompat1.test.ts

This file was deleted.

8 changes: 0 additions & 8 deletions packages/types/src/address.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@ import { describe, expect, test } from 'vitest';
import { parseIntoAddr } from './address.js';

describe('parseIntoAddr', () => {
test('works with compat', () => {
expect(() =>
parseIntoAddr(
'penumbracompat1147mfall0zr6am5r45qkwht7xqqrdsp50czde7empv7yq2nk3z8yyfh9k9520ddgswkmzar22vhz9dwtuem7uxw0qytfpv7lk3q9dp8ccaw2fn5c838rfackazmgf3ahhwqq0da',
),
).not.toThrow();
});

test('works with normal addresses', () => {
expect(() =>
parseIntoAddr(
Expand Down
4 changes: 0 additions & 4 deletions packages/types/src/address.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { Address } from '@penumbra-zone/protobuf/penumbra/core/keys/v1/keys_pb';
import { addressFromBech32m } from '@penumbra-zone/bech32m/penumbra';
import { compatAddressFromBech32, isCompatAddress } from '@penumbra-zone/bech32m/penumbracompat1';

export const parseIntoAddr = (addrStr: string): Address => {
if (isCompatAddress(addrStr)) {
return new Address(compatAddressFromBech32(addrStr));
}
return new Address(addressFromBech32m(addrStr));
};

0 comments on commit 28054ef

Please sign in to comment.