Skip to content

Commit

Permalink
Cleaner GetBlobHash clauses
Browse files Browse the repository at this point in the history
Co-authored-by: cabrador <84449820+cabrador@users.noreply.github.com>
  • Loading branch information
rpl-ffl and cabrador authored Sep 24, 2024
1 parent 87cfa91 commit a44d970
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions protobuf/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,14 @@ func (msg *Substate_TxMessage) decode(lookup dbGetCode) (*substate.Message, erro
var blobHashes []types.Hash = nil
switch txType {
case Substate_TxMessage_TXTYPE_BLOB:
if msg.GetBlobHashes() != nil {
blobHashes = make([]types.Hash, len(msg.GetBlobHashes()))
for i, hash := range msg.GetBlobHashes() {
blobHashes[i] = types.BytesToHash(hash)
}
}
msgBlobHashes := msg.GetBlobHashes()
if msgBlobHashes == nil {
break
}
blobHashes = make([]types.Hash, len(msgBlobHashes))
for i, hash := range msgBlobHashes {
blobHashes[i] = types.BytesToHash(hash)
}
}

return &substate.Message{
Expand Down

0 comments on commit a44d970

Please sign in to comment.