-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EIP-39: monotonic creation height rule #1865
Conversation
src/main/scala/org/ergoplatform/modifiers/mempool/ErgoTransaction.scala
Outdated
Show resolved
Hide resolved
|
||
val tokens = boxCandidate.additionalTokens.map { case (id, amount) => | ||
if (java.util.Arrays.equals(id, assetId)) assetId -> deltaFn(amount) else assetId -> amount | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The search over boxCandidate.additionalTokens happens 3 times. Passing an index in additionalTokens will be both faster and cleaner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is testing code
} | ||
|
||
private def checkTx(from: IndexedSeq[ErgoBox], wrongTx: ErgoTransaction): Try[Int] = { | ||
wrongTx.statelessValidity().flatMap(_ => wrongTx.statefulValidity(from, emptyDataBoxes, emptyStateContext)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add comment on why it is called wrongTx
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of scope of this PR, renamed to tx anyway
…ion.scala Co-authored-by: Alexander Slesarenko <aslesarenko@users.noreply.github.com>
…onic-creationheight
…go into monotonic-creationheight
Do you mean "its creation height is not less or equal to than max creation height in inputs" ? |
There are other inputs (with much higher heights) besides the pool box in the update tx. |
not less means equal or greater |
In this PR, EIP-39 (ergoplatform/eips#80) is implemented as follows: