Skip to content
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

Add VMInput.PrevTxHash #2470

Merged
merged 2 commits into from Nov 13, 2020
Merged

Conversation

camilbancioiu
Copy link
Contributor

@camilbancioiu camilbancioiu commented Nov 13, 2020

Set the PrevTxHash field of VMInput whenever instantiating it.

The PrevTxHash is needed in Arwen for asynchronous calls, primarily to distinguish between chains of calls. It is also used by the elrond-wasm-rs framework to build storage keys for persisting information between steps of an asynchronous call.

@@ -83,6 +83,7 @@ func (sc *scProcessor) createVMCallInput(
scr, isSCR := tx.(*smartContractResult.SmartContractResult)
if isSCR {
vmCallInput.OriginalTxHash = scr.GetOriginalTxHash()
vmCallInput.PrevTxHash = scr.PrevTxHash
} else {
vmCallInput.OriginalTxHash = txHash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add to else prevtxhash as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

@camilbancioiu camilbancioiu merged commit 960ed12 into feat/esdt-relayed-arwen Nov 13, 2020
@camilbancioiu camilbancioiu deleted the vmInput-prevTxHash branch November 13, 2020 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants