convex icon indicating copy to clipboard operation
convex copied to clipboard

Behavior of accept depends of context

Open Darkneew opened this issue 3 years ago • 1 comments

The behavior of accept changes, depending of wether you are calling it from an ordinary callable function or from receive-coin.

When calling accept from an ordinary function, if the tip given is more than the amount accepted, the tip will be reduced to the amount accepted. Moreover, when calling accept with something else than a number, it raises an error. Capture d’écran 2022-08-03 132250

However, when calling accept from receive-coin, the result is independant of the argument given to accept. Whatever may be given to accept (it can even be nil), the transfer will be accepted fully. Capture d’écran 2022-08-03 132058

Darkneew avatar Aug 03 '22 05:08 Darkneew

Interesting. I think the first behaviour is correct (should fail with an accept of a non-integer argument) we probably need to build a test case for the second to see what is happening.

mikera avatar Aug 22 '22 15:08 mikera