From ed06732e5b5906ea2dae2e3dcca894ef79f943b3 Mon Sep 17 00:00:00 2001 From: valentine Date: Mon, 1 Apr 2024 21:23:59 +0300 Subject: [PATCH] fix rust lint and idb test --- .../storage/src/indexed-db/indexed-db.test.ts | 15 +++++++-------- packages/wasm/crate/tests/keys.rs | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/storage/src/indexed-db/indexed-db.test.ts b/packages/storage/src/indexed-db/indexed-db.test.ts index 29d2642e64..a544c82c68 100644 --- a/packages/storage/src/indexed-db/indexed-db.test.ts +++ b/packages/storage/src/indexed-db/indexed-db.test.ts @@ -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, @@ -46,7 +46,6 @@ 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 @@ -54,9 +53,9 @@ describe('IndexedDb', () => { chainId: 'test', accountAddr: 'penumbra123xyz', dbVersion: 1, - walletId: bech32ToWalletId( - 'penumbrawalletid15r7q7qsf3hhsgj0g530n7ng9acdacmmx9ajknjz38dyt90u9gcgsmjre75', - ), + walletId: new WalletId({ + inner: new Uint8Array(8) + }), }); describe('initializing', () => { @@ -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); diff --git a/packages/wasm/crate/tests/keys.rs b/packages/wasm/crate/tests/keys.rs index 6e02789bf5..4a5c23e272 100644 --- a/packages/wasm/crate/tests/keys.rs +++ b/packages/wasm/crate/tests/keys.rs @@ -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()); }