TezosTaqueria / taqueria

*BETA* Taqueria provides a seamless development workflow to easily build, test and deploy your Tezos applications.
https://taqueria.io
Apache License 2.0
64 stars 20 forks source link

šŸ› Bug āž¾ Contract Types: Entrypoints is wrong for nested entrypoints #1315

Open ricklove opened 2 years ago

ricklove commented 2 years ago

The TZIP-12 spec includes an update_operators entrypoint that is called with a parameter of two objects, add_operator and remove_operator. However, the taq generate types task is interpreting the add_operator and remove_operator objects as entrypoints, and generating methods for those:

type Methods = {
    transfer: (param: Array<{
            from_: address;
            txs: Array<{
                to_: address;
                token_id: nat;
                amount: nat;
            }>;
        }>) => Promise<void>;
    balance_of: (
        requests: Array<{
            owner: address;
            token_id: nat;
        }>,
        callback: contract,
    ) => Promise<void>;
    add_operator: (
        owner: address,
        operator: address,
        token_id: nat,
    ) => Promise<void>;
    remove_operator: (
        owner: address,
        operator: address,
        token_id: nat,
    ) => Promise<void>;
};

However, instead it should generate an update_operators method.

More info here: https://tezostaquito.io/docs/fa2_parameters/#the-update_operators-entrypoint

Example contract: NFT.tz.txt

sinapsist commented 2 years ago

@ricklove Can you, please, provide a good example of how to reproduce it?

hu3man commented 1 year ago

@ricklove, can you please add some additional context for this ticket?