Skip to content

Commit

Permalink
fix rust lint and idb test
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentine1898 committed Apr 1, 2024
1 parent 108d4dc commit ed06732
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions packages/storage/src/indexed-db/indexed-db.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
transactionId,
} from './indexed-db.test-data';
import { GasPrices } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/fee/v1/fee_pb';
import { AddressIndex } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/keys/v1/keys_pb';
import {AddressIndex, WalletId} from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/keys/v1/keys_pb';
import {
PositionId,
PositionState,
Expand All @@ -46,17 +46,16 @@ import {
} from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb';
import { localAssets } from '@penumbra-zone/constants/src/assets';
import type { IdbUpdate, PenumbraDb } from '@penumbra-zone/types/src/indexed-db';
import { bech32ToWalletId } from '@penumbra-zone/bech32/src/wallet-id';

describe('IndexedDb', () => {
// uses different wallet ids so no collisions take place
const generateInitialProps = () => ({
chainId: 'test',
accountAddr: 'penumbra123xyz',
dbVersion: 1,
walletId: bech32ToWalletId(
'penumbrawalletid15r7q7qsf3hhsgj0g530n7ng9acdacmmx9ajknjz38dyt90u9gcgsmjre75',
),
walletId: new WalletId({
inner: new Uint8Array(8)
}),
});

describe('initializing', () => {
Expand Down Expand Up @@ -97,9 +96,9 @@ describe('IndexedDb', () => {
chainId: 'test',
accountAddr: 'penumbra123xyz',
dbVersion: 2,
walletId: bech32ToWalletId(
'penumbrawalletid15r7q7qsf3hhsgj0g530n7ng9acdacmmx9ajknjz38dyt90u9gcgsmjre75',
),
walletId: new WalletId({
inner: new Uint8Array(10)
}),
};

const dbB = await IndexedDb.initialize(version2Props);
Expand Down
2 changes: 1 addition & 1 deletion packages/wasm/crate/tests/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ fn successfully_get_wallet_id() {
// revise this test since we cannot call wasm-bindgen imported functions on non-wasm targets
fn raises_if_fvk_invalid() {
let fvk = FullViewingKey::from_str("penumbrafullviewingkey1sjeaceqzgaeye2ksnz8q73mp6rpx2ykdtzs8wurrnhwdn8vqwuxhxtjdndrjc74udjh0uch0tatnrd93q50wp9pfk86h3lgpew8lsqsz2a6la").unwrap();
let err = get_wallet_id(&fvk.encode_to_vec().as_slice()).unwrap_err();
let err = get_wallet_id(fvk.encode_to_vec().as_slice()).unwrap_err();
assert_eq!("invalid length", err.to_string());
}

0 comments on commit ed06732

Please sign in to comment.