Unexpected: no event emitted, unchanged balance while running locally

I was following the “Run Move locally” tutorial, and I created one account and minted 100 token into it, compiled and publish the module (with one identity procedure) and finally compile and execute the script which utilizes the module.

I changed the tx script slightly to:

import 0x0.LibraAccount;
import 0x0.LibraCoin;
import {{sender}}.MyModule;

main(amount: u64) {
  let coin: LibraCoin.T;
  coin = LibraAccount.withdraw_from_sender(move(amount));
  // deposit into any other account, should see decrease in sender's balance
  LibraAccount.deposit(0x1, MyModule.id(move(coin)));
  return;
}

here’s what I’ve got from my Libra CLI:

So basically two things went unexpectedly:

  1. no event emitted
  2. the balance remains unchanged

Not sure whether I did anything wrong.

Maybe you can try

%dev c 0 language/stdlib/transaction_scripts/peer_to_peer_transfer.mvir script
%dev e 0 language/stdlib/transaction_scripts/peer_to_peer_transfer.mv 000000000000000000000000000000000000000000000000000000000a550c18 1
%q b 000000000000000000000000000000000000000000000000000000000a550c18

to see if it work.

And “compile 0” , “execute 1” seems wrong.

1 Like