Skip to content

Commit

Permalink
Fix wallet.MessageV5
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksej-paschenko committed Jul 9, 2024
1 parent 3ce9935 commit 5d39ce2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions wallet/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,15 +473,22 @@ func (m *MessageV5Beta) RawMessages() []RawMessage {
func (m *MessageV5) RawMessages() []RawMessage {
switch m.SumType {
case "SignedInternal":
msgs := make([]RawMessage, 0, len(*m.SignedInternal.Actions))
for _, action := range *m.SignedInternal.Actions {
if m.SignedInternal == nil || m.SignedInternal.Actions == nil {
return nil
}
actions := m.SignedInternal.Actions
msgs := make([]RawMessage, 0, len(*actions))
for _, action := range *actions {
msgs = append(msgs, RawMessage{
Message: action.Msg,
Mode: action.Mode,
})
}
return msgs
case "SignedExternal":
if m.SignedExternal == nil || m.SignedExternal.Actions == nil {
return nil
}
msgs := make([]RawMessage, 0, len(*m.SignedExternal.Actions))
for _, action := range *m.SignedExternal.Actions {
msgs = append(msgs, RawMessage{
Expand Down

0 comments on commit 5d39ce2

Please sign in to comment.