massalabs / massa

The Decentralized and Scaled Blockchain
https://massa.net
5.58k stars 717 forks source link

SendMessage not working #3469

Closed AurelienFT closed 1 year ago

AurelienFT commented 1 year ago

Message from one of our tech-ambassador on Discord :

Hey people, I am trying to execute async-calls example of ours. I updated and deployed the contract but the generate events inside the run.ts are not triggered so I think sendMesage function is not working. You can check my fork in order to see the code I am using: https://github.com/nirnaeth-arnoediad/massa-sc-examples/tree/main/async-calls

My procedure is:

npm install
npm run build
npm run deploy

Before this procedure I deployed a project with our toolkit and change the code acording to async-calls example

Output is:

command > get_filtered_sc_output_event operation_id=O14h3Msqwmbtj5bJtsDyD6uuF7ibZR9WMvTnj6Sn1QLPR3vYbWH
Context: Slot: (period: 115360, thread: 15) at index: 0
On chain execution
Block id: B12a8Fg9Zgh9ef4pgUimx2sKw4BywTMixtHFm9T1ouQTfgNfLJq2
Origin operation id: O14h3Msqwmbtj5bJtsDyD6uuF7ibZR9WMvTnj6Sn1QLPR3vYbWH
Call stack: A1yBuHitvccgdMEcyKY1Xd2zaKNhmXQBCVc5niBW6ETYAZXWZsL

Data: Contract deployed at address: A12jr3D2hnkNSJq49z8bNz8vt89sFwLigsB1kwy5781rJH6jfjjx
AurelienFT commented 1 year ago

This is not a bug it's just that the example isn't up to date to be deployed using the deployer and we should update it. The problem is that the receive function is included with the transformer but it shouldn't be used anymore so the receive function doesn't exist and the SC can't sendMessage pointing to this function. I have opened an issue to update this example: https://github.com/massalabs/massa-sc-examples/issues/45