This repository has been archived by the owner on Mar 20, 2024. It is now read-only.
forked from move-language/move
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle entry functions with non-empty list of arguments (#260)
- Loading branch information
Showing
4 changed files
with
149 additions
and
11 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
17 changes: 17 additions & 0 deletions
17
language/tools/move-mv-llvm-compiler/tests/rbpf-tests/entry-point04.json
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,17 @@ | ||
{ | ||
"program_id": "DozgQiYtGbdyniV2T74xMdmjZJvYDzoRFFqw7UR5MwPK", | ||
"accounts": [ | ||
{ | ||
"key": "524HMdYYBy6TAn4dK5vCcjiTmT2sxV6Xoue5EXrz22Ca", | ||
"owner": "BPFLoaderUpgradeab1e11111111111111111111111", | ||
"is_signer": false, | ||
"is_writable": true, | ||
"lamports": 1000, | ||
"data": [ | ||
59, 180, 10, 27, 53, 174, 68, 250, 182, 197, 64, 125, 20, 13, 245, 130, 63, 209, 147, 189, 65, 82, 20, 53, 37, 71, 8, 125, 94, 87, 32, 27, | ||
23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, | ||
2, 3, 5, 7, 11, 13, 17, 19] | ||
} | ||
], | ||
"instruction_data": [101, 110, 116, 114, 121, 95, 112, 111, 105, 110, 116, 95, 95, 116, 114, 97, 110, 115, 102, 101, 114] | ||
} |
35 changes: 35 additions & 0 deletions
35
language/tools/move-mv-llvm-compiler/tests/rbpf-tests/entry-point04.move
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,35 @@ | ||
// input entry-point04.json | ||
|
||
// A phony `signer` module until we build `move-stdlib`. | ||
module 0x500::signer { | ||
native public fun borrow_address(acct: &signer): &address; | ||
|
||
// Copies the address of the signer | ||
public fun address_of(s: &signer): address { | ||
*borrow_address(s) | ||
} | ||
} | ||
|
||
module 0xa000::entry_point { | ||
use 0x500::signer; | ||
|
||
public entry fun bar(): u64 { | ||
0 | ||
} | ||
|
||
public entry fun foo(): u64 { | ||
17 | ||
} | ||
|
||
public entry fun transfer( | ||
sender: &signer, | ||
receiver: address, | ||
amount: u64, | ||
): u64 | ||
{ | ||
assert!(signer::address_of(sender) == @0x1b20575e7d08472535145241bd93d13f82f50d147d40c5b6fa44ae351b0ab43b, 0xf0000); | ||
assert!(receiver == @0xada7a39d97958b89837f716d6b67656159534f4947433d3b352f2b29251f1d17, 0xf001); | ||
assert!(amount == 0x13110d0b07050302, 0xf002); | ||
0 | ||
} | ||
} |