Skip to content

Commit a943af9

Browse files
JFWooten4codex
andcommitted
🐹 Fix Go channel rotation account handling
Co-authored-by: Codex <noreply@openai.com>
1 parent 4d1c980 commit a943af9

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

docs/build/guides/transactions/channel-accounts.mdx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -859,9 +859,10 @@ func main() {
859859

860860
// index = 0-4 in our example
861861
for index, account := range channelAccounts {
862+
simpleAccount := txnbuild.NewSimpleAccount(account.AccountID, account.Sequence)
862863
channelAccountsTracker[index] = map[string]interface{}{
863-
"account": account,
864-
"keypair": channelKeypairs[i],
864+
"account": &simpleAccount,
865+
"keypair": channelKeypairs[index],
865866
"state": "available",
866867
}
867868
}
@@ -908,7 +909,7 @@ func main() {
908909
tx, err = tx.Sign(
909910
network.TestNetworkPassphrase,
910911
primaryKeypair,
911-
channelData["keypair"].(*keypair.Full)
912+
channelData["keypair"].(*keypair.Full),
912913
)
913914
check(err)
914915

@@ -918,8 +919,9 @@ func main() {
918919
channelData map[string]interface{}
919920
}{
920921
transaction: tx,
921-
channelData: channelData
922-
})
922+
channelData: channelData,
923+
},
924+
)
923925
} else {
924926
fmt.Println("No available channel account. Waiting...")
925927
// Perhaps sleep here

0 commit comments

Comments
 (0)