chainweb-node icon indicating copy to clipboard operation
chainweb-node copied to clipboard

Calling `coin.transfer` on an account that doesn't exist should throw an error

Open mightybyte opened this issue 6 years ago • 2 comments

Currently, the request key comes back with Write succeeded.

Wallet transcript:

Sent code to chain '0':

(coin.account-balance "colin")

ERROR: : Failure: Tx Failed: with-read: row not found: colin
Sent code to chain '0':

(coin.account-balance "croesus")

Server result: 8997898999.99999999762
Sent code to chain '0':

(coin.transfer "croesus" "colin" 500.0)

Server result: "SUsdcLI_CvKqngETqbiExnORQqkwalKhDHaiO1HTHn8"
Sent code to chain '0':

(coin.account-balance "croesus")

Server result: 8997898999.99999999662

Request key poll results:

λ poll net (rk "SUsdcLI_CvKqngETqbiExnORQqkwalKhDHaiO1HTHn8")
Right (PollResponses (fromList [("SUsdcLI_CvKqngETqbiExnORQqkwalKhDHaiO1HTHn8",CommandResult {_crReqKey = "tIZQR3nXPV63oBezI6xB-asqzxy7oOjF-a2UwC__izM", _crTxId = Just 16456, _crResult = PactResult (Right (PLiteral (LString {_lString = "Write succeeded"}))), _crGas = Gas 52, _crLogs = Just "umfpFAaHIGp3XN2juPvuctx3dW
ok2AVvw6RyHlQwR9U", _crContinuation = Nothing, _crMetaData = Nothing})]))

mightybyte avatar Sep 03 '19 20:09 mightybyte

Also, there is a slight discrepancy between the results of the two coin.account-balance calls for croesus.

emmanueldenloye avatar Sep 03 '19 20:09 emmanueldenloye

I believe that is expected because the transaction went in and gas got charged. Just the transfer failed.

mightybyte avatar Sep 03 '19 20:09 mightybyte