-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rename JsonAbi MessageType property * add smo contract * add test case for smo contract * remove unnused types from contract * add new method to exhaustive examples contract * add test case to interfaces test * add changeset * ajust test case * re-add test case removed by accident * refact test case * update changeset * update SMO contract interface * implement decodeMessage at Interface class * decoding message data at assembleResult * modify test case * modify changeset Co-authored-by: Nedim Salkić <[email protected]> * remove uneeded test case * remove code to decode message * improve test case --------- Co-authored-by: Nedim Salkić <[email protected]>
- Loading branch information
1 parent
47b5cd3
commit 48db506
Showing
8 changed files
with
101 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@fuel-ts/abi-typegen": patch | ||
"@fuel-ts/abi-coder": patch | ||
--- | ||
|
||
feat: support message types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/fuel-gauge/test/fixtures/forc-projects/smo-contract/Forc.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[project] | ||
authors = ["Fuel Labs <[email protected]>"] | ||
entry = "main.sw" | ||
license = "Apache-2.0" | ||
name = "smo-contract" | ||
|
||
[dependencies] |
28 changes: 28 additions & 0 deletions
28
packages/fuel-gauge/test/fixtures/forc-projects/smo-contract/src/main.sw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
contract; | ||
|
||
use std::message::send_typed_message; | ||
use std::bytes::Bytes; | ||
|
||
abi SMOContract { | ||
#[payable] | ||
fn send_typed_message_bool(recipient: b256, msg_data: bool, coins: u64); | ||
#[payable] | ||
fn send_typed_message_u8(recipient: b256, msg_data: u8, coins: u64); | ||
#[payable] | ||
fn send_typed_message_bytes(recipient: b256, msg_data: Bytes, coins: u64); | ||
} | ||
|
||
impl SMOContract for Contract { | ||
#[payable] | ||
fn send_typed_message_bool(recipient: b256, msg_data: bool, coins: u64) { | ||
send_typed_message(recipient, msg_data, coins); | ||
} | ||
#[payable] | ||
fn send_typed_message_u8(recipient: b256, msg_data: u8, coins: u64) { | ||
send_typed_message(recipient, msg_data, coins); | ||
} | ||
#[payable] | ||
fn send_typed_message_bytes(recipient: b256, msg_data: Bytes, coins: u64) { | ||
send_typed_message(recipient, msg_data, coins); | ||
} | ||
} |