@@ -21,8 +21,8 @@ import (
21
21
horizoneffects "github.com/stellar/go/protocols/horizon/effects"
22
22
"github.com/stellar/go/protocols/horizon/operations"
23
23
"github.com/stellar/go/txnbuild"
24
+ "github.com/threefoldtech/tfchain/bridge/tfchain_bridge/pkg"
24
25
substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
25
- "github.com/threefoldtech/tfchain_bridge/pkg"
26
26
)
27
27
28
28
const (
@@ -42,6 +42,8 @@ type StellarWallet struct {
42
42
sequenceNumber int64
43
43
}
44
44
45
+ type TraceIdKey struct {}
46
+
45
47
func NewStellarWallet (ctx context.Context , config * pkg.StellarConfig ) (* StellarWallet , error ) {
46
48
kp , err := keypair .ParseFull (config .StellarSeed )
47
49
@@ -93,7 +95,7 @@ func (w *StellarWallet) CreatePaymentAndReturnSignature(ctx context.Context, tar
93
95
}
94
96
95
97
func (w * StellarWallet ) CreatePaymentWithSignaturesAndSubmit (ctx context.Context , target string , amount uint64 , txHash string , signatures []substrate.StellarSignature , sequenceNumber int64 ) error {
96
- ctx_with_trace_id := context .WithValue (ctx , "trace_id" , txHash )
98
+ ctx_with_trace_id := context .WithValue (ctx , TraceIdKey {} , txHash )
97
99
98
100
txnBuild , err := w .generatePaymentOperation (amount , target , sequenceNumber )
99
101
if err != nil {
@@ -122,7 +124,7 @@ func (w *StellarWallet) CreatePaymentWithSignaturesAndSubmit(ctx context.Context
122
124
}
123
125
124
126
func (w * StellarWallet ) CreateRefundPaymentWithSignaturesAndSubmit (ctx context.Context , target string , amount uint64 , txHash string , signatures []substrate.StellarSignature , sequenceNumber int64 ) error {
125
- ctx_with_trace_id := context .WithValue (ctx , "trace_id" , txHash )
127
+ ctx_with_trace_id := context .WithValue (ctx , TraceIdKey {} , txHash )
126
128
txnBuild , err := w .generatePaymentOperation (amount , target , sequenceNumber )
127
129
if err != nil {
128
130
return err
0 commit comments