Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Goal: Add check for signer passed in the case of logic sig rekeyed account #3773

Merged
merged 4 commits into from
Mar 18, 2022

Conversation

barnjamin
Copy link
Contributor

@barnjamin barnjamin commented Mar 15, 2022

Summary

When trying to sign a transaction file with goal, if the sender is a normal address but the signer is a logic program, the call fails with an error message like:

send.txn: txn[0] error LogicNot signed and not a Logic-only account

The error message comes from

// if the txn.Authorizer() == hash(Logic) then this is a (potentially) valid operation on a contract-only account

It notes that a valid case is when Auth is set to the hash of the program but we aren't setting the auth on the transaction even if the -S flag is passed

Test Plan

Made a txn where sender is a regular account and signed it with

goal clerk sign -i tmp.txn -o tmp.txn -S BJATCHES5YJZJ7JITYMVLSSIQAVAWBQRVGPQUDT5AZ2QSLDSXWWM46THOY -p tmp.teal

I borked the git history on the last one #3459 so just nuked it and starting over here.

Left it at @tsachiherman wanting better tests for this #3459 (comment)

@barnjamin barnjamin added bug Something isn't working Bug-Fix labels Mar 15, 2022
@tsachiherman
Copy link
Contributor

For me, this PR was abit confusing since it was completely omitting the fact that we're taking about a logicsig account that was rekeyed.

@tsachiherman
Copy link
Contributor

Could you please take a look on the test failures ?

+ goal -w E1BC5E2446A40EDEA92E12A9F331A0E0 clerk sign -i /opt/cibuild/project/tmp/out/e2e/139021-1647380295636/E1BC5E2446A40EDEA92E12A9F331A0E0/gx-0.tx -p /opt/cibuild/project/tmp/out/e2e/139021-1647380295636/E1BC5E2446A40EDEA92E12A9F331A0E0/split.teal -o /opt/cibuild/project/tmp/out/e2e/139021-1647380295636/E1BC5E2446A40EDEA92E12A9F331A0E0/gx-0.stx
Signer invalid (): decoded bad addr:

@barnjamin barnjamin requested a review from tsachiherman March 17, 2022 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Bug-Fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants