Skip to content

Commit

Permalink
fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
aljo242 committed Aug 22, 2022
1 parent 3980420 commit b22db28
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 11 deletions.
4 changes: 1 addition & 3 deletions ignite/cmd/node_query_bank_balances.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package ignitecmd

import (
"fmt"

"github.com/ignite/cli/ignite/pkg/cliui"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -53,7 +51,7 @@ func nodeQueryBankBalancesHandler(cmd *cobra.Command, args []string) error {

var rows [][]string
for _, b := range balances {
rows = append(rows, []string{fmt.Sprintf("%s", b.Amount), b.Denom})
rows = append(rows, []string{b.String()})
}

session.StopSpinner()
Expand Down
3 changes: 2 additions & 1 deletion ignite/pkg/cosmosaccount/cosmosaccount_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ func TestRegistry(t *testing.T) {
require.Equal(t, getAccount.Name, account.Name)
require.Equal(t, getAccount.Name, account.Record.Name)

addr = account.Address("cosmos")
addr, err = account.Address("cosmos")
require.NoError(t, err)
getAccount, err = registry.GetByAddress(addr)
require.NoError(t, err)
require.Equal(t, getAccount.Record.PubKey, account.Record.PubKey)
Expand Down
7 changes: 6 additions & 1 deletion ignite/pkg/cosmosclient/bank.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ func (c Client) BankBalances(ctx context.Context, address string, pagination *qu
}

func (c Client) BankSendTx(fromAccount cosmosaccount.Account, toAddress string, amount sdk.Coins) (TxService, error) {
addr, err := fromAccount.Address(c.addressPrefix)
if err != nil {
return TxService{}, err
}

msg := &banktypes.MsgSend{
FromAddress: fromAccount.Address(c.addressPrefix),
FromAddress: addr,
ToAddress: toAddress,
Amount: amount,
}
Expand Down
2 changes: 1 addition & 1 deletion ignite/services/network/launch.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (n Network) RevertLaunch(launchID uint64, chain Chain) error {
}

msg := launchtypes.NewMsgRevertLaunch(address, launchID)
_, err = n.cosmos.BroadcastTx(n.account.Name, msg)
_, err = n.cosmos.BroadcastTx(n.account, msg)
if err != nil {
return err
}
Expand Down
6 changes: 5 additions & 1 deletion integration/node/cmd_query_bank_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ func TestNodeQueryBankBalances(t *testing.T) {
assertBankBalanceOutput(t, b.String(), "5600atoken,1200btoken")

b.Reset()

aliceAddr, err := aliceAccount.Address(testPrefix)
require.NoError(t, err)

env.Exec("query bank balances by address",
step.NewSteps(step.New(
step.Exec(
Expand All @@ -144,7 +148,7 @@ func TestNodeQueryBankBalances(t *testing.T) {
"query",
"bank",
"balances",
aliceAccount.Address(testPrefix),
aliceAddr,
"--node", node,
"--keyring-dir", accKeyringDir,
"--address-prefix", testPrefix,
Expand Down
13 changes: 9 additions & 4 deletions integration/node/cmd_tx_bank_send_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ func TestNodeTxBankSend(t *testing.T) {
return
}

bobAddr, err := bobAccount.Address(testPrefix)
require.NoError(t, err)
aliceAddr, err := aliceAccount.Address(testPrefix)
require.NoError(t, err)

env.Exec("send 2stake from bob to alice using addresses",
step.NewSteps(step.New(
step.Exec(
Expand All @@ -140,8 +145,8 @@ func TestNodeTxBankSend(t *testing.T) {
"tx",
"bank",
"send",
bobAccount.Address(testPrefix),
aliceAccount.Address(testPrefix),
bobAddr,
aliceAddr,
"2stake",
"--node", node,
"--keyring-dir", accKeyringDir,
Expand All @@ -163,7 +168,7 @@ func TestNodeTxBankSend(t *testing.T) {
"bank",
"send",
"alice",
bobAccount.Address(testPrefix),
bobAddr,
"5token",
"--node", node,
"--keyring-dir", accKeyringDir,
Expand Down Expand Up @@ -244,7 +249,7 @@ func TestNodeTxBankSend(t *testing.T) {

require.Contains(t, b.String(),
fmt.Sprintf(`"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"%s","to_address":"%s","amount":[{"denom":"token","amount":"5"}]}]`,
aliceAccount.Address(testPrefix), bobAccount.Address(testPrefix)),
aliceAddr, bobAddr),
)
require.Contains(t, b.String(), `"signatures":[]`)

Expand Down

0 comments on commit b22db28

Please sign in to comment.