#How auth with source account
23 messages · Page 1 of 1 (latest)
Oh, I see, addressWithNonce is supposed to be None in that case.
Maybe we shouldn't use Option for that field, and instead use a different enum with values SourceAccount or Address.
It's make it a little clearer. None address with nonce == Source Account is logical, but it is not intuitive/obvious.
yeah, maybe
On the surface if you think that change might be reasonable I can open a PR with it and we can evaluate if it's good in a PR.
that's reasonable, but I'd like to postpone it until after the preview release in order to not accumulate more xdr changes that need to be propagated everywhere
For next release.
Hmm, actually, is it accurate for the default case to be "SourceAccount"? Can this invoker auth be used for contracts as well, so should it be Invoker?
if you mean whether default should be source account or an address - I don't really care much; I'm not sure if there are any conventions on default in xdr (it would probably safer if by default the address was filled and invoker was used explicitly - this way there is always something set explicitly)
I think we shouldn't use the 'invoker' term to not introduce more confusion; this is strictly a special case of the source account signature being effectively 'forwarded' to the host
Is setting addressWithNonce to None also how a contract can be the invoker for auth?
ideally it wouldn't be needed at all, but that might make things even more confusing
it can't (in transaction)
How does a contract auth with another contract?
for the subcontract calls contract is considered to have authorized anything on its behalf; authorizing the trees from a contract is still not supported (There is an issue for that though)
for the subcontract calls contract is considered to have authorized anything on its behalf
Do I need to construct aContractAuthfor this case?
When I do, do I set addressWithNonce to None?
no, you don't need to. doing a subcontract call automatically provides authorization