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

Workaround (quick fix) to support construction of cross-shard transactions #52

Merged
merged 2 commits into from
Oct 5, 2022

Conversation

andreibancioiu
Copy link
Contributor

@andreibancioiu andreibancioiu commented Oct 5, 2022

Add support for constructing cross-shard transactions - handle receiver and value from the preprocess metadata, when they are present.

Related to: multiversx/mx-chain-rosetta-checks#7

The construction API will be partly refactored in #51.

@andreibancioiu andreibancioiu self-assigned this Oct 5, 2022
@andreibancioiu andreibancioiu added the type:bug Something isn't working label Oct 5, 2022
@andreibancioiu andreibancioiu marked this pull request as ready for review October 5, 2022 08:03
if len(operations) > 1 {
options["value"] = operations[1].Amount.Value
} else {
options["value"] = strings.Trim(operations[0].Amount.Value, "-")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a temporary workaround - will be refactored in #51.

options["sender"] = operations[0].Account.Address

if metadata["receiver"] != nil {
options["receiver"] = metadata["receiver"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The receiver from the metadata takes priority.

}

if metadata["value"] != nil {
options["value"] = metadata["value"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The value from the metadata takes priority.

@miiu96 miiu96 self-requested a review October 5, 2022 10:27
@bogdan-rosianu bogdan-rosianu self-requested a review October 5, 2022 10:30
@andreibancioiu andreibancioiu merged commit 6e6122e into main Oct 5, 2022
@andreibancioiu andreibancioiu deleted the construction-cross branch October 5, 2022 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants