-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Write app call addresses in txn_participation table.
- Loading branch information
1 parent
9833f05
commit eda1a3a
Showing
4 changed files
with
102 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package accounting | ||
|
||
import ( | ||
"github.com/algorand/go-algorand/data/basics" | ||
"github.com/algorand/go-algorand/data/transactions" | ||
) | ||
|
||
// GetTransactionParticipants calls function `add` for every address referenced in the | ||
// given transaction, possibly with repetition. | ||
func GetTransactionParticipants(stxnad *transactions.SignedTxnWithAD, includeInner bool, add func(address basics.Address)) { | ||
txn := &stxnad.Txn | ||
|
||
add(txn.Sender) | ||
add(txn.Receiver) | ||
add(txn.CloseRemainderTo) | ||
add(txn.AssetSender) | ||
add(txn.AssetReceiver) | ||
add(txn.AssetCloseTo) | ||
add(txn.FreezeAccount) | ||
|
||
for _, address := range txn.ApplicationCallTxnFields.Accounts { | ||
add(address) | ||
} | ||
|
||
if includeInner { | ||
for _, inner := range stxnad.ApplyData.EvalDelta.InnerTxns { | ||
GetTransactionParticipants(&inner, includeInner, add) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters