Skip to content

Commit

Permalink
fix(core/substrate): fix decode tuple error
Browse files Browse the repository at this point in the history
  • Loading branch information
Gkirito committed Dec 20, 2023
1 parent 05619f7 commit 14c884f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions core/substrate/types/customscale/argType.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,13 @@ func DecodeByTypeID(metadata *types.Metadata, arg *ArgDecoder, typeId types.Si1L
}
return values, nil
case si1Type.Def.IsTuple:
var filed types.Si1TypeDefTuple
err := arg.Decode(&filed)
if err != nil {
return nil, err
var filed []any
for _, tupleTypeId := range si1Type.Def.Tuple {
singleData, err := DecodeByTypeID(metadata, arg, tupleTypeId)
if err != nil {
return nil, err
}
filed = append(filed, singleData)
}
return filed, nil
case si1Type.Def.IsHistoricMetaCompat:
Expand Down

0 comments on commit 14c884f

Please sign in to comment.