From 3d0fa381f89f6f8fc2d4bff33924548a402bc8bd Mon Sep 17 00:00:00 2001 From: GG <863867759@qq.com> Date: Mon, 8 Jan 2024 12:17:56 +0800 Subject: [PATCH] feat: account info support starknet cairo version. --- core/wallet/cache_test.go | 2 +- core/wallet/cache_wallet.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/wallet/cache_test.go b/core/wallet/cache_test.go index 64093a6..162d674 100644 --- a/core/wallet/cache_test.go +++ b/core/wallet/cache_test.go @@ -168,5 +168,5 @@ func TestDecimalPrivatekey(t *testing.T) { t.Log(wallet.AptosAccountInfo().Address()) t.Log(wallet.SuiAccountInfo().Address()) t.Log(wallet.StarcoinAccountInfo().Address()) - t.Log(wallet.StarknetAccountInfo().Address()) + t.Log(wallet.StarknetAccountInfo(false).Address()) } diff --git a/core/wallet/cache_wallet.go b/core/wallet/cache_wallet.go index 5188923..8aa9881 100644 --- a/core/wallet/cache_wallet.go +++ b/core/wallet/cache_wallet.go @@ -271,10 +271,10 @@ func (w *CacheWallet) StarcoinAccountInfo() *AccountInfo { } } -func (w *CacheWallet) StarknetAccountInfo() *AccountInfo { +func (w *CacheWallet) StarknetAccountInfo(isCairo0 bool) *AccountInfo { return &AccountInfo{ Wallet: w, - cacheKey: "starknet", + cacheKey: fmt.Sprintf("starknet-%v", isCairo0), mnemonicCreator: func(val string) (base.Account, error) { return starknet.NewAccountWithMnemonic(val) },