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

cmd: Improve logicsig with signer support for goal clerk send #6180

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Set logic sig address as sender if sender is not provided
  • Loading branch information
nullun committed Nov 25, 2024
commit f244a5cd264ebaf55865a846177522f0b6251bca
6 changes: 5 additions & 1 deletion cmd/goal/clerk.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,11 @@ var sendCmd = &cobra.Command{
if program != nil {
ph := logic.HashProgram(program)
pha := basics.Address(ph)
fromAddressResolved = pha.String()
if account == "" {
fromAddressResolved = pha.String()
} else {
fromAddressResolved = accountList.getAddressByName(account)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The else of the program != nil test has some similar logic. It seems like each arm could assign to account if account is currently empty (in the lsig case, by hashing and such, in the non-lsig case by looking up the default), and then after the if/else we can unconditionally do fromAddressResolved = accountList.getAddressByName(account), just like the assignment to toAddressResolved is done unconditionally.

programArgs = getProgramArgs()
} else {
// Check if from was specified, else use default
Expand Down