Skip to content

Commit

Permalink
comments improved
Browse files Browse the repository at this point in the history
  • Loading branch information
kushti committed Jan 9, 2025
1 parent ea31523 commit 18a6a77
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion data/shared/src/main/scala/sigma/eval/AvlTreeVerifier.scala
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ trait AvlTreeVerifier {
*
* @param key key to look up
* @param value value to check it was inserted or updated
* @return Success(Some(value)), Success(None), or Failure
* @return Success(Some(oldValue)) if there was some oldValue associated with the key,
* Success(None) in case of insertion, or Failure if proof invalid
*/
def performInsertOrUpdate(key: Array[Byte], value: Array[Byte]): Try[Option[Array[Byte]]]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ class CErgoTreeEvaluator(
// the cost of tree lookup is O(bv.treeHeight)
addSeqCost(InsertIntoAvlTree_Info, nItems) { () =>
val insertRes = bv.performInsert(key.toArray, value.toArray)
// TODO v6.0: throwing exception is not consistent with update semantics
// however it preserves v4.0 semantics (see https://github.com/ScorexFoundation/sigmastate-interpreter/issues/908)
// For versioned change details, see see https://github.com/ScorexFoundation/sigmastate-interpreter/issues/908
if (insertRes.isFailure && !VersionContext.current.isV6SoftForkActivated) {
syntax.error(s"Incorrect insert for $tree (key: $key, value: $value, digest: ${tree.digest}): ${insertRes.failed.get}}")
}
Expand Down

0 comments on commit 18a6a77

Please sign in to comment.