-
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.
bug: fix code being shifted when loaded via LDC (#1503)
- Loading branch information
1 parent
c7f6806
commit fc6eb56
Showing
6 changed files
with
95 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[project] | ||
authors = ["Fuel Labs <contact@fuel.sh>"] | ||
entry = "main.sw" | ||
license = "Apache-2.0" | ||
name = "proxy" | ||
|
||
[dependencies] |
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,29 @@ | ||
contract; | ||
|
||
use std::execution::run_external; | ||
|
||
abi Proxy { | ||
#[storage(write)] | ||
fn set_target_contract(id: ContractId); | ||
|
||
// this targets the method of the `huge_contract` in our e2e sway contracts | ||
#[storage(read)] | ||
fn something() -> u64; | ||
} | ||
|
||
storage { | ||
target_contract: Option<ContractId> = None, | ||
} | ||
|
||
impl Proxy for Contract { | ||
#[storage(write)] | ||
fn set_target_contract(id: ContractId) { | ||
storage.target_contract.write(Some(id)); | ||
} | ||
|
||
#[storage(read)] | ||
fn something() -> u64 { | ||
let target = storage.target_contract.read().unwrap(); | ||
run_external(target) | ||
} | ||
} |
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