* Migrate pieces of x/genutil missed in 6734 * Fix tests * Fix lint * Add test
This commit is contained in:
@@ -60,6 +60,10 @@ func newBuilder(pubkeyCodec types.PublicKeyCodec) *builder {
|
||||
}
|
||||
|
||||
func (t *builder) GetMsgs() []sdk.Msg {
|
||||
if t.tx == nil || t.tx.Body == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
anys := t.tx.Body.Messages
|
||||
res := make([]sdk.Msg, len(anys))
|
||||
for i, any := range anys {
|
||||
|
||||
@@ -110,6 +110,11 @@ func TestTxBuilder(t *testing.T) {
|
||||
require.Equal(t, len(msgs), len(tx.GetMsgs()))
|
||||
require.Equal(t, 1, len(tx.GetPubKeys()))
|
||||
require.Equal(t, pubkey.Bytes(), tx.GetPubKeys()[0].Bytes())
|
||||
|
||||
tx = &builder{}
|
||||
require.NotPanics(t, func() {
|
||||
_ = tx.GetMsgs()
|
||||
})
|
||||
}
|
||||
|
||||
func TestBuilderValidateBasic(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user