From bcf1e6201f9843b72dcea70952fff310fc87c6cf Mon Sep 17 00:00:00 2001 From: user Date: Wed, 6 Dec 2023 14:21:00 +1030 Subject: [PATCH 1/2] Log the transaction hash instead of user action --- cmd/microservice-solana-worker-server/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/microservice-solana-worker-server/main.go b/cmd/microservice-solana-worker-server/main.go index dc932c970..71471ff54 100644 --- a/cmd/microservice-solana-worker-server/main.go +++ b/cmd/microservice-solana-worker-server/main.go @@ -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, ) }) From 95afd8642f90c0772fcd3c273d2d7f691c0b30f8 Mon Sep 17 00:00:00 2001 From: user Date: Wed, 6 Dec 2023 14:43:30 +1030 Subject: [PATCH 2/2] Add the signature hash to the logging --- cmd/microservice-solana-worker-client/main.go | 2 +- common/solana/util.go | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/microservice-solana-worker-client/main.go b/cmd/microservice-solana-worker-client/main.go index 9ea61d6e9..0c69db24e 100644 --- a/cmd/microservice-solana-worker-client/main.go +++ b/cmd/microservice-solana-worker-client/main.go @@ -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) }) }) } diff --git a/common/solana/util.go b/common/solana/util.go index 023bf4894..ebd8f5499 100644 --- a/common/solana/util.go +++ b/common/solana/util.go @@ -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)