GENERALBYTESCOM / batm_public

BATM Public Repository
www.generalbytes.com
Other
98 stars 241 forks source link

ITransactionListener callbacks not being called #451

Closed alexisdevtailor closed 3 years ago

alexisdevtailor commented 3 years ago

Hello,

I am Alexis Azanza, a developer for DagCoin in VisionCraft working under mikk.laos@visioncraft.ee. My question is about the Java code of batm. Our extension implemented the com.generalbytes.batm.server.extensions.ITransactionListener interface. I noticed that isTransactionApproved() method is not being called when we call IWallet.sendCoins(). From my understanding, isTransactionApproved() should be called before sendCoins(). Is this correct? If not, how do we use this interface and make sure it is going to be called by the server? Basically we need to be able to get the terminal serial number inside sendCoins(). Thank you in advance.

Regards, Alexis Azanza Screenshot 2020-11-12 at 12 57 54 Screenshot 2020-11-12 at 12 21 19 Screenshot 2020-11-12 at 12 40 15 Screenshot 2020-11-12 at 12 40 28 Screenshot 2020-11-12 at 12 54 02

generalbytes commented 3 years ago

Are you sure that you are calling IExtensionContext.addTransactionListener to actually register listener for being called? See example: https://github.com/GENERALBYTESCOM/batm_public/blob/1bc688f86c1897fd82596dc6317fb2713bdd221b/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/extra/examples/TransactionExtension.java#L41

alexisdevtailor commented 3 years ago

No worries, I think I found the answer. I forgot to call addTransactionListener. I will give this a try. Thanks.

![Uploading Screenshot 2020-11-12 at 13.14.08.png…]()