diff --git a/src/main/scala/sigmastate/serialization/ErgoTreeSerializer.scala b/src/main/scala/sigmastate/serialization/ErgoTreeSerializer.scala index e21c19a286..f1d29608f6 100644 --- a/src/main/scala/sigmastate/serialization/ErgoTreeSerializer.scala +++ b/src/main/scala/sigmastate/serialization/ErgoTreeSerializer.scala @@ -29,9 +29,9 @@ class ErgoTreeSerializer { def deserializeErgoTree(r: SigmaByteReader): ErgoTree = { val (h, cs) = deserializeHeader(r) + val previousConstantStore = r.constantStore r.constantStore = new ConstantStore(cs) // reader with constant store attached is required (to get tpe for a constant placeholder) - val previousConstantStore = r.constantStore val root = ValueSerializer.deserialize(r) r.constantStore = previousConstantStore ErgoTree(h, cs, root)