aeternity / aesophia

Stand alone compiler for the Sophia smart contract language
https://docs.aeternity.com/aesophia
ISC License
52 stars 19 forks source link

Oracle extend docs #419

Closed jyeshe closed 1 year ago

jyeshe commented 2 years ago

Hi, I have tried to use the Oracle.extend from std lib however it was only possible if the contract called Oracle.extend(o, signature = sign, ttl) instead of Oracle.extend(sign, o, ttl).

The test was made with sdk at this version: @aeternity/aepp-sdk@12.1.3 /home/rogerio/Workspace/ae/aepp-sdk-js

jyeshe commented 2 years ago

possibly applicable to Oracle.respond

hanssv commented 1 year ago

Named arguments can't be used without their name, but they can be given in any position, thus the possible ways to call Oracle.extend are:

    Oracle.extend(o, t)
    Oracle.extend(signature = sig, o, t)
    Oracle.extend(o, signature = sig, t)
    Oracle.extend(o, t, signature = sig)
jyeshe commented 1 year ago

Named arguments can't be used without their name, but they can be given in any position, thus the possible ways to call Oracle.extend are:

    Oracle.extend(o, t)
    Oracle.extend(signature = sig, o, t)
    Oracle.extend(o, signature = sig, t)
    Oracle.extend(o, t, signature = sig)

The docs shows the signature as the first argument: https://github.com/aeternity/aesophia/blob/256df25af4274dc5daadb36b252460b1be39a747/docs/sophia_stdlib.md?plain=1#L850

jyeshe commented 1 year ago

Named arguments can't be used without their name, but they can be given in any position, thus the possible ways to call Oracle.extend are:

    Oracle.extend(o, t)
    Oracle.extend(signature = sig, o, t)
    Oracle.extend(o, signature = sig, t)
    Oracle.extend(o, t, signature = sig)

You're right, doesn't matter to move it to the last argument on the docs. Thanks for clarifying.