Skip to content

Commit

Permalink
Merge pull request #382 from ScorexFoundation/fix-ergo-tree-deser-pre…
Browse files Browse the repository at this point in the history
…vious-constant-store

Fix previous constant preservation on ergo tree deserialization
  • Loading branch information
aslesarenko authored Feb 1, 2019
2 parents 696f9f1 + b15fcf7 commit 07bf22d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 07bf22d

Please sign in to comment.