mesg-foundation / engine

Build apps or autonomous workflows with reusable, shareable integrations connecting any service, app, blockchain or decentralized network.
https://mesg.com/
Apache License 2.0
130 stars 13 forks source link

Cannot purchase a service #935

Closed antho1404 closed 5 years ago

antho1404 commented 5 years ago

I cannot purchase a service that doesn't belong to me. The service exists, the offer also exists. The address has sufficient funds

➜  core git:(dev) ✗ mesg-core marketplace purchase marketplace
? Enter the account to use 0xfde8b69e8eee1c116bc678602a752c909189f955
? Enter passphrase *
? Enter the offer index to purchase 0
? Are you sure to purchase service "marketplace" for 1 MESG Tokens and for a duration of 36000 seconds? Yes
Returned error: gas required exceeds allowance or always failing transaction
NicolasMahe commented 5 years ago

I find the source of the problem: it's the function to estimate the gas needed. As your account didn't allow the smart contract of the marketplace to spend token on its behalf, the transaction to buy will always failed...

antho1404 commented 5 years ago

let's force the maximum number of gas that these transactions can consume. We need to test the maximum amount of gas the contract will need for the allowance and the purchase and then we can double it to make sure that we will always have enough.

nice catch