Skip to content

Commit dfd4bc3

Browse files
committed
update bridge repo path
1 parent 8187bc7 commit dfd4bc3

File tree

7 files changed

+20
-18
lines changed

7 files changed

+20
-18
lines changed

bridge/tfchain_bridge/go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/threefoldtech/tfchain_bridge
1+
module github.com/threefoldtech/tfchain/bridge/tfchain_bridge
22

33
go 1.17
44

@@ -52,4 +52,4 @@ require (
5252
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
5353
)
5454

55-
replace github.com/threefoldtech/tfchain/clients/tfchain-client-go => ../../clients/tfchain-client-go
55+
replace github.com/threefoldtech/tfchain/clients/tfchain-client-go => ../../clients/tfchain-client-go

bridge/tfchain_bridge/main.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import (
99

1010
"github.com/rs/zerolog/log"
1111
flag "github.com/spf13/pflag"
12-
"github.com/threefoldtech/tfchain_bridge/pkg"
13-
"github.com/threefoldtech/tfchain_bridge/pkg/bridge"
14-
"github.com/threefoldtech/tfchain_bridge/pkg/logger"
12+
"github.com/threefoldtech/tfchain/bridge/tfchain_bridge/pkg"
13+
"github.com/threefoldtech/tfchain/bridge/tfchain_bridge/pkg/bridge"
14+
"github.com/threefoldtech/tfchain/bridge/tfchain_bridge/pkg/logger"
1515
)
1616

1717
func main() {

bridge/tfchain_bridge/pkg/bridge/bridge.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import (
88
"github.com/pkg/errors"
99
"github.com/rs/zerolog"
1010
"github.com/rs/zerolog/log"
11-
"github.com/threefoldtech/tfchain_bridge/pkg"
12-
"github.com/threefoldtech/tfchain_bridge/pkg/stellar"
13-
subpkg "github.com/threefoldtech/tfchain_bridge/pkg/substrate"
11+
"github.com/threefoldtech/tfchain/bridge/tfchain_bridge/pkg"
12+
"github.com/threefoldtech/tfchain/bridge/tfchain_bridge/pkg/stellar"
13+
subpkg "github.com/threefoldtech/tfchain/bridge/tfchain_bridge/pkg/substrate"
1414
)
1515

1616
const (

bridge/tfchain_bridge/pkg/bridge/mint.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010
"github.com/rs/zerolog"
1111
"github.com/rs/zerolog/log"
1212
hProtocol "github.com/stellar/go/protocols/horizon"
13+
"github.com/threefoldtech/tfchain/bridge/tfchain_bridge/pkg"
14+
_logger "github.com/threefoldtech/tfchain/bridge/tfchain_bridge/pkg/logger"
1315
substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
14-
"github.com/threefoldtech/tfchain_bridge/pkg"
15-
_logger "github.com/threefoldtech/tfchain_bridge/pkg/logger"
1616
)
1717

1818
// mint handler for stellar

bridge/tfchain_bridge/pkg/bridge/refund.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"github.com/rs/zerolog"
88
"github.com/rs/zerolog/log"
99
hProtocol "github.com/stellar/go/protocols/horizon"
10-
"github.com/threefoldtech/tfchain_bridge/pkg"
11-
_logger "github.com/threefoldtech/tfchain_bridge/pkg/logger"
12-
subpkg "github.com/threefoldtech/tfchain_bridge/pkg/substrate"
10+
"github.com/threefoldtech/tfchain/bridge/tfchain_bridge/pkg"
11+
_logger "github.com/threefoldtech/tfchain/bridge/tfchain_bridge/pkg/logger"
12+
subpkg "github.com/threefoldtech/tfchain/bridge/tfchain_bridge/pkg/substrate"
1313
)
1414

1515
// refund handler for stellar

bridge/tfchain_bridge/pkg/bridge/withdraw.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import (
99
"github.com/centrifuge/go-substrate-rpc-client/v4/types"
1010
"github.com/rs/zerolog"
1111
"github.com/rs/zerolog/log"
12+
"github.com/threefoldtech/tfchain/bridge/tfchain_bridge/pkg"
13+
subpkg "github.com/threefoldtech/tfchain/bridge/tfchain_bridge/pkg/substrate"
1214
substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
13-
"github.com/threefoldtech/tfchain_bridge/pkg"
14-
subpkg "github.com/threefoldtech/tfchain_bridge/pkg/substrate"
1515
)
1616

1717
func (bridge *Bridge) handleWithdrawCreated(ctx context.Context, withdraw subpkg.WithdrawCreatedEvent) error {

bridge/tfchain_bridge/pkg/stellar/stellar.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import (
2121
horizoneffects "github.com/stellar/go/protocols/horizon/effects"
2222
"github.com/stellar/go/protocols/horizon/operations"
2323
"github.com/stellar/go/txnbuild"
24+
"github.com/threefoldtech/tfchain/bridge/tfchain_bridge/pkg"
2425
substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
25-
"github.com/threefoldtech/tfchain_bridge/pkg"
2626
)
2727

2828
const (
@@ -42,6 +42,8 @@ type StellarWallet struct {
4242
sequenceNumber int64
4343
}
4444

45+
type TraceIdKey struct{}
46+
4547
func NewStellarWallet(ctx context.Context, config *pkg.StellarConfig) (*StellarWallet, error) {
4648
kp, err := keypair.ParseFull(config.StellarSeed)
4749

@@ -93,7 +95,7 @@ func (w *StellarWallet) CreatePaymentAndReturnSignature(ctx context.Context, tar
9395
}
9496

9597
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)
9799

98100
txnBuild, err := w.generatePaymentOperation(amount, target, sequenceNumber)
99101
if err != nil {
@@ -122,7 +124,7 @@ func (w *StellarWallet) CreatePaymentWithSignaturesAndSubmit(ctx context.Context
122124
}
123125

124126
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)
126128
txnBuild, err := w.generatePaymentOperation(amount, target, sequenceNumber)
127129
if err != nil {
128130
return err

0 commit comments

Comments
 (0)