Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Apr 10, 2024
1 parent 116d9c5 commit 8c42fdc
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions x/tx/signing/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,8 @@ func (c *Context) makeGetSignersFunc(descriptor protoreflect.MessageDescriptor)
arr = append(arr, res...)
}
return arr, nil
} else {
return fieldGetter(msg.Get(childField).Message(), depth+1)
}
return fieldGetter(msg.Get(childField).Message(), depth+1)
case childField.IsMap() || childField.HasOptionalKeyword():
return nil, fmt.Errorf("cosmos.msg.v1.signer field %s in message %s must not be a map or optional", signerFieldName, desc.FullName())
case childField.Kind() == protoreflect.StringKind:
Expand All @@ -266,14 +265,13 @@ func (c *Context) makeGetSignersFunc(descriptor protoreflect.MessageDescriptor)
res = append(res, addrBz)
}
return res, nil
} else {
addrStr := msg.Get(childField).String()
addrBz, err := addrCdc.StringToBytes(addrStr)
if err != nil {
return nil, err
}
return [][]byte{addrBz}, nil
}
addrStr := msg.Get(childField).String()
addrBz, err := addrCdc.StringToBytes(addrStr)
if err != nil {
return nil, err
}
return [][]byte{addrBz}, nil
}
return nil, fmt.Errorf("unexpected field type %s for field %s in message %s, only string and message type are supported",
childField.Kind(), signerFieldName, desc.FullName())
Expand Down

0 comments on commit 8c42fdc

Please sign in to comment.