Skip to content

Commit

Permalink
Merge pull request #2439 from fluidity-money/develop-improve-logging-…
Browse files Browse the repository at this point in the history
…transaction-hash-solana

Log the transaction hash instead of user action
  • Loading branch information
af-afk authored Dec 8, 2023
2 parents 9d7718c + 95afd86 commit c5b74ef
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/microservice-solana-worker-client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ and instruction data %+v`,
}

log.App(func(k *log.Log) {
k.Format("Sent payout transaction with signature %v", sig)
k.Format("Sent payout transaction with signature hash %v", sig)
})
})
}
4 changes: 2 additions & 2 deletions cmd/microservice-solana-worker-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ func main() {

log.Debug(func(k *log.Log) {
k.Format(
"Found winning transaction %v winning %v tokens!",
userAction,
"Found winning transaction hash %v winning %v tokens!",
userActionTransactionHash,
winningAmount,
)
})
Expand Down
5 changes: 5 additions & 0 deletions common/solana/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ type Message struct {

type Signature [64]byte

func (s Signature) String() string {
b := [64]byte(s)
return base58.Encode(b[:])
}

func SignatureFromBase58(b58 string) (Signature, error) {
sigBytes := base58.Decode(b58)

Expand Down

0 comments on commit c5b74ef

Please sign in to comment.