Skip to content

Commit

Permalink
Handle unmarshalling library cell to boc.Cell
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksej-paschenko committed Sep 12, 2024
1 parent 7a9f925 commit 3cd1b93
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tlb/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ func decode(c *boc.Cell, tag string, val reflect.Value, decoder *Decoder) error
return err
}
if c.IsLibrary() {
if val.Kind() == reflect.Struct && val.Type() == bocCellType {
// this is a library cell, and we unmarshal it to a cell.
// let's not resolve it and keep it as is
val.Set(reflect.ValueOf(c).Elem())
return nil
}
return fmt.Errorf("library cell as a ref is not implemented")
}
if c.CellType() == boc.PrunedBranchCell {
Expand Down

0 comments on commit 3cd1b93

Please sign in to comment.