Open mitchmindtree opened 2 months ago
Yeh I can clean that up a bit. One area this does come up is with authentication. We currently are doing:
var auth_addr: PredicateAddress;
@auth(auth_addr; key; auth::@burn());
Technically we could put the var inside the macro as it's only use in there. This avoids the user of the @auth
library macro needing to know that they have to pass in this var which they never even use. This is especially a problem because there's no type signature on macros.
I do see the other side of this though, you can really look at it both ways (all inputs as args to a giant function vs vars used within scopes).
I think we should also include vars declared in other files in this convo (if that's actually possible atm).
This is a follow-up to the discussion in #772 starting here.
@freesig I'm still open to the idea that they might be useful, but I think in the use-case you gave I'd probably write it a little differently, e.g.
@verify_sig
or similar, and receive a sig+key pair as input.__mut_keys_len() == 0
condition like@no_mutations()
or something.I guess it's a bit more verbose, but feels a little more readable? :thinking: