Skip to content

Commit

Permalink
Don't convert data to base58
Browse files Browse the repository at this point in the history
  • Loading branch information
gagliardetto committed May 20, 2024
1 parent 4c9c412 commit a1b4e28
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions adapters.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,17 +234,18 @@ func adaptTransactionMetaToExpectedOutput(m map[string]any) map[string]any {
} else {
instruction["accounts"] = []any{}
}
if data, ok := instruction["data"]; ok {
// as string
dataStr, ok := data.(string)
if ok {
decoded, err := base64.StdEncoding.DecodeString(dataStr)
if err == nil {
// TODO: the data in the `innerInstructions` is always base58 encoded (even if the transaction is base64 encoded)
instruction["data"] = base58.Encode(decoded)
}
}
}
// if data, ok := instruction["data"]; ok {
// // as string
// dataStr, ok := data.(string)
// if ok {
// decoded, err := base64.StdEncoding.DecodeString(dataStr)
// if err == nil {
// // TODO: the data in the `innerInstructions` is always base58 encoded (even if the transaction is base64 encoded)
// // instruction["data"] = base58.Encode(decoded)
// _ = decoded
// }
// }
// }
}
}
meta["innerInstructions"].([]any)[i] = innerInstruction
Expand Down

0 comments on commit a1b4e28

Please sign in to comment.