Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implement the GM opcode #340

Merged
merged 7 commits into from
Oct 31, 2021
Merged

Implement the GM opcode #340

merged 7 commits into from
Oct 31, 2021

Conversation

sezna
Copy link
Contributor

@sezna sezna commented Oct 27, 2021

Add the GM opcode to the Sway language, as per the new specs.

Closes #339

This PR also updates sway to the latest fuel-asm with the latest op mapping and fixes the corresponding contract addresses.

@sezna sezna self-assigned this Oct 27, 2021
@sezna sezna marked this pull request as ready for review October 27, 2021 22:45
@sezna sezna added the compiler General compiler. Should eventually become more specific as the issue is triaged label Oct 27, 2021
vlopes11
vlopes11 previously approved these changes Oct 27, 2021
Copy link
Contributor

@vlopes11 vlopes11 left a comment

Choose a reason for hiding this comment

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

LGTM

@sezna sezna marked this pull request as draft October 28, 2021 02:02
@sezna sezna marked this pull request as ready for review October 30, 2021 16:53
@sezna sezna requested a review from vlopes11 October 30, 2021 17:43
Copy link
Contributor

@vlopes11 vlopes11 left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -4,8 +4,8 @@ use serde::{Deserialize, Serialize};
use std::path::{Path, PathBuf};
use std::{io, iter, slice};

pub type Id = [u8; Bytes32::size_of()];
pub type Contract = [u8; ContractId::size_of()];
pub type Id = [u8; Bytes32::LEN];
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand why we don't use the raw types if they can just be represented as &[u8] via https://github.com/FuelLabs/fuel-types/blob/565ac6a25343e487faf10c13c42fb5168f92b087/src/types.rs#L130-L134

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not know, was just updating for the api. @leviathanbeak any word on why these types are like this?

@sezna sezna merged commit 665dcda into master Oct 31, 2021
@sezna sezna deleted the sezna/gm_opcode branch October 31, 2021 05:36
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
compiler General compiler. Should eventually become more specific as the issue is triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement the GM opcode in Sway
2 participants