From aa41ee8d8483e2ff749751c154338c2b46f27d34 Mon Sep 17 00:00:00 2001 From: jtieri Date: Tue, 11 Jul 2023 17:18:31 -0500 Subject: [PATCH] get balance checks completely working --- chain/penumbra/penumbra_app_node.go | 1 + chain/penumbra/penumbra_client_node.go | 4 +--- examples/penumbra/penumbra_chain_test.go | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/chain/penumbra/penumbra_app_node.go b/chain/penumbra/penumbra_app_node.go index 96bc1a352..5df73f30b 100644 --- a/chain/penumbra/penumbra_app_node.go +++ b/chain/penumbra/penumbra_app_node.go @@ -216,6 +216,7 @@ func (p *PenumbraAppNode) GenerateGenesisFile( "testnet", "generate", "--chain-id", chainID, + "--preserve-chain-id", "--validators-input-file", p.ValidatorsInputFileContainer(), "--allocations-input-file", p.AllocationsInputFileContainer(), } diff --git a/chain/penumbra/penumbra_client_node.go b/chain/penumbra/penumbra_client_node.go index 6d7c4a85c..b11dcbb81 100644 --- a/chain/penumbra/penumbra_client_node.go +++ b/chain/penumbra/penumbra_client_node.go @@ -283,9 +283,7 @@ func (p *PenumbraClientNode) GetBalance(ctx context.Context, denom string) (*big continue } - fmt.Printf("%v '%s'\n", metadata.Display, translateHiAndLo(b.Amount.Hi, b.Amount.Lo).String()) - - if metadata.Display == denom { + if metadata.Base == denom { return translateHiAndLo(b.Amount.Hi, b.Amount.Lo), nil } } diff --git a/examples/penumbra/penumbra_chain_test.go b/examples/penumbra/penumbra_chain_test.go index c8e5aa19e..7efef33e6 100644 --- a/examples/penumbra/penumbra_chain_test.go +++ b/examples/penumbra/penumbra_chain_test.go @@ -54,7 +54,7 @@ func TestPenumbraChainStart(t *testing.T) { node := chain.(*penumbra.PenumbraChain).PenumbraNodes[0] - bal, err := chain.GetBalance(ctx, node.PenumbraClientNodes["validator"].KeyName, "") + bal, err := chain.GetBalance(ctx, node.PenumbraClientNodes["validator"].KeyName, chain.Config().Denom) require.NoError(t, err) t.Logf("Balance: %d \n", bal)