Closed ghost closed 1 year ago
This is Aptos specific functionality, so in general, please open issues in aptos-core.
As regards this particular error, unit tests do not call init_module automatically, so you must call it yourself at the beginning of a test.
This is Aptos specific functionality, so in general, please open issues in aptos-core.
As regards this particular error, unit tests do not call init_module automatically, so you must call it yourself at the beginning of a test.
Sorry but it doesnt related Aptos specific functionality fun init_module
, Just try to change name to fun init_modules
then it still got same error.
It IS specific for Aptos Move. Also read again what I wrote, I gave you the solution.
On Sat, Mar 4, 2023 at 10:07 AM e99243506bigplay @.***> wrote:
This is Aptos specific functionality, so in general, please open issues in aptos-core.
As regards this particular error, unit tests do not call init_module automatically, so you must call it yourself at the beginning of a test.
Sorry but it doesnt related Aptos specific functionality fun init_module, Just try to change name to fun init_modules then it still got same error.
โ Reply to this email directly, view it on GitHub https://github.com/move-language/move/issues/962#issuecomment-1454806920, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC2MSOSJZEVULNSLZBQZEWLW2NZFBANCNFSM6AAAAAAVOQKNGI . You are receiving this because you modified the open/close state.Message ID: @.***>
It IS specific for Aptos Move. Also read again what I wrote, I gave you the solution. โฆ On Sat, Mar 4, 2023 at 10:07 AM e99243506bigplay @.> wrote: This is Aptos specific functionality, so in general, please open issues in aptos-core. As regards this particular error, unit tests do not call init_module automatically, so you must call it yourself at the beginning of a test. Sorry but it doesnt related Aptos specific functionality fun init_module, Just try to change name to fun init_modules then it still got same error. โ Reply to this email directly, view it on GitHub <#962 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC2MSOSJZEVULNSLZBQZEWLW2NZFBANCNFSM6AAAAAAVOQKNGI . You are receiving this because you modified the open/close state.Message ID: @.>
Now what? IS It still same be Aptos Move? Please hint me what the solution is?
Code:
module me::test3 {
struct Test0 has key {}
public entry fun test() acquires Test0 {
borrow_global_mut<Test0>(@0x22);
}
#[test(framework = @0x1)]
fun a() {
test();
}
}
Move.toml:
[package]
name = 'tst3'
version = '1.0.0'
[dependencies]
AptosFramework={local="../aptos-core/aptos-move/framework/aptos-framework"}
[addresses]
#me = "0xd1b58e44ea11ffd326a280c453b080fd8af294298815a00e65b6e2bffc48d6ac"
me = "0x22"
Output: (on aptos-main branch)
$ ../move-lang/target/x86_64-unknown-linux-gnu/release/move test
INCLUDING DEPENDENCY AptosFramework
INCLUDING DEPENDENCY AptosStdlib
INCLUDING DEPENDENCY MoveStdlib
BUILDING tst3
error[E04020]: missing acquires annotation
โโ ./sources/a.move:10:9
โ
4 โ public entry fun test() acquires Test0 {
โ ----- The call acquires '(me=0x22)::test3::Test0', but the 'acquires' list for the current function does not contain this type. It must be present in the calling context's acquires list
ยท
10 โ test();
โ ^^^^^^ Invalid call to '(me=0x22)::test3::test'
Even add line move_to(framework, Test0 {});
on beginning of test code, that wont work too.
It IS specific for Aptos Move. Also read again what I wrote, I gave you the solution. โฆ On Sat, Mar 4, 2023 at 10:07 AM e99243506bigplay @.> wrote: This is Aptos specific functionality, so in general, please open issues in aptos-core. As regards this particular error, unit tests do not call init_module automatically, so you must call it yourself at the beginning of a test. Sorry but it doesnt related Aptos specific functionality fun init_module, Just try to change name to fun init_modules then it still got same error. โ Reply to this email directly, view it on GitHub <#962 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC2MSOSJZEVULNSLZBQZEWLW2NZFBANCNFSM6AAAAAAVOQKNGI . You are receiving this because you modified the open/close state.Message ID: @.>
Finally, the problem was fun a(framework: &signer)
lack of acquires Test0
signature. The move compiler was misleading me. Thanks to Magnum6#6523 to provide the solution.
Can you please ask such questions on the Aptos discord? GitHub issues should only be opened if you actually found a bug, not for questions how to use Move. This takes away valuable time of the Move developers. You will also get much faster help. Finally, if you really think you found a bug, never open it here but in the aptos-core repo.
Can you please ask such questions on the Aptos discord? GitHub issues should only be opened if you actually found a bug, not for questions how to use Move. This takes away valuable time of the Move developers. You will also get much faster help. Finally, if you really think you found a bug, never open it here but in the aptos-core repo.
Move compiler error message was misleading me to open a Github issue, and I didn't know that solution was so simple at all that like a newbie Move question. Well, as you wish, I will ask any question on Aptos discord at future.
๐ Bug
To reproduce
Code snippet to reproduce
Stack trace/error message
Expected Behavior
Should be pass the compile then do the test.
System information
Please complete the following information:
Arch Linux
Additional context
Add any other context about the problem here.
is it Chicken or eggs paradox? lol. you want egg, but no chicken, you want chicken, but no egg :eyes: