Skip to content

Commit

Permalink
fix get addr and update protos
Browse files Browse the repository at this point in the history
  • Loading branch information
jtieri committed Aug 8, 2023
1 parent eb14aec commit 15bb77f
Show file tree
Hide file tree
Showing 6 changed files with 632 additions and 381 deletions.
156 changes: 51 additions & 105 deletions chain/penumbra/core/ibc/v1alpha1/ibc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 13 additions & 7 deletions chain/penumbra/core/transaction/v1alpha1/transaction.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 17 additions & 11 deletions chain/penumbra/penumbra_app_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,19 +235,25 @@ func (p *PenumbraAppNode) GetAddress(ctx context.Context, keyName string) ([]byt
return nil, err
}

addresses := strings.Split(string(stdout), "\n")
for _, address := range addresses {
fields := strings.Fields(address)
if len(fields) < 3 {
continue
}
if fields[1] == keyName {
// TODO penumbra address is bech32m. need to decode to bytes here
return []byte(fields[2]), nil
}
if len(stdout) == 0 {
return []byte{}, errors.New("address not found")
}

return []byte{}, errors.New("address not found")
return stdout, nil

//addresses := strings.Split(string(stdout), "\n")
//for _, address := range addresses {
// fields := strings.Fields(address)
// if len(fields) < 3 {
// continue
// }
// if fields[1] == keyName {
// // TODO penumbra address is bech32m. need to decode to bytes here
// return []byte(fields[2]), nil
// }
//}
//
//return []byte{}, errors.New("address not found")
}

func (p *PenumbraAppNode) GetBalance(ctx context.Context, keyName string) (int64, error) {
Expand Down
2 changes: 1 addition & 1 deletion chain/penumbra/penumbra_client_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (p *PenumbraClientNode) SendFunds(ctx context.Context, amount ibc.WalletAmo
},
AssetId: &cryptov1alpha1.AssetId{AltBaseDenom: amount.Denom},
},
Address: &cryptov1alpha1.Address{Inner: []byte(amount.Address)},
Address: &cryptov1alpha1.Address{AltBech32M: amount.Address},
}},
}

Expand Down
Loading

0 comments on commit 15bb77f

Please sign in to comment.