Skip to content

Commit

Permalink
Merge pull request #6 from hyle-team/feature/tokene-contracts
Browse files Browse the repository at this point in the history
Implement tokene contracts
  • Loading branch information
slbmax authored Oct 7, 2024
2 parents 874d67f + 3dd8ee8 commit c99e3c7
Show file tree
Hide file tree
Showing 35 changed files with 2,069 additions and 663 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ config.*.yaml
docs/node_modules
docs/web_deploy
vendor/

bridgeless-signer
1,799 changes: 1,598 additions & 201 deletions contracts/bridge.go

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion docs/static/service.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@
},
"withdrawalAmount": {
"type": "string"
},
"signature": {
"type": "string"
}
}
},
Expand Down Expand Up @@ -189,7 +192,8 @@
"TX_PENDING",
"TX_FAILED",
"TX_SUCCESSFUL",
"REPROCESSING"
"REPROCESSING",
"WITHDRAWAL_SIGNED"
],
"default": "PROCESSING"
},
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ require (
github.com/alecthomas/kingpin v2.2.6+incompatible
github.com/cosmos/cosmos-sdk v0.46.13
github.com/go-ozzo/ozzo-validation v3.6.0+incompatible
github.com/grpc-ecosystem/grpc-gateway/v2 v2.21.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0
github.com/ignite/cli v0.26.1
github.com/pkg/errors v0.9.1
github.com/rubenv/sql-migrate v1.6.1
gitlab.com/distributed_lab/figure v2.1.2+incompatible
gitlab.com/distributed_lab/kit v1.11.3
gitlab.com/distributed_lab/logan v3.8.1+incompatible
google.golang.org/genproto/googleapis/api v0.0.0-20240723171418-e6d459c13d2a
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142
google.golang.org/grpc v1.64.1
google.golang.org/protobuf v1.34.2
)
Expand All @@ -25,10 +25,11 @@ require (
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0
github.com/cosmos/gogoproto v1.5.0
github.com/ethereum/go-ethereum v1.10.26
github.com/hyle-team/bridgeless-core v0.0.0-20240911163215-e9a1ef12c6da
github.com/hyle-team/bridgeless-core v0.0.0-20241003084139-414cc4a6f73c
github.com/lib/pq v1.10.9
github.com/rabbitmq/amqp091-go v1.10.0
github.com/spf13/cast v1.6.0
github.com/stretchr/testify v1.9.0
gitlab.com/distributed_lab/figure/v3 v3.1.4
)

Expand Down Expand Up @@ -127,7 +128,6 @@ require (
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.18.2 // indirect
github.com/stretchr/testify v1.9.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
Expand All @@ -151,9 +151,9 @@ require (
golang.org/x/net v0.26.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/text v0.17.0 // indirect
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240723171418-e6d459c13d2a // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
28 changes: 14 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1719,8 +1719,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.21.0 h1:CWyXh/jylQWp2dtiV33mY4iSSp6yf4lmn+c7/tN+ObI=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.21.0/go.mod h1:nCLIt0w3Ept2NwF8ThLmrppXsfT07oC8k0XNDxd8sVU=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I=
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU=
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0=
github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s=
Expand Down Expand Up @@ -1784,8 +1784,8 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO
github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ=
github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y=
github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o=
github.com/hyle-team/bridgeless-core v0.0.0-20240911163215-e9a1ef12c6da h1:r7V5qDnd+6AIaMSx463+mq8vhMrY8p2NxQWzPgHBGew=
github.com/hyle-team/bridgeless-core v0.0.0-20240911163215-e9a1ef12c6da/go.mod h1:E416XZ8/nZ4Te3gzqYFcasErEvv8JHXpR9nMBMdxLI8=
github.com/hyle-team/bridgeless-core v0.0.0-20241003084139-414cc4a6f73c h1:qb+y1pQTA7TriAWloTozC9uyVGY6z36Qy4wjsaS4/O0=
github.com/hyle-team/bridgeless-core v0.0.0-20241003084139-414cc4a6f73c/go.mod h1:F0UTxyTcS5Fmu0Ecw+7lU+c5L5A/PhaInaP6wB/RLu0=
github.com/hyle-team/cosmos-sdk v0.46.20 h1:2pd+6xOEf3c9CgIG2be/Rl3X3wAuTwL+hJT5v+33Db4=
github.com/hyle-team/cosmos-sdk v0.46.20/go.mod h1:nIfy+qNyHSoV2b901hNglQNVvHGK/9vrnMlgJU6SsIM=
github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
Expand Down Expand Up @@ -2606,8 +2606,8 @@ golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBch
golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0=
golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74OwM=
golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM=
golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs=
golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA=
golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand All @@ -2628,8 +2628,8 @@ golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down Expand Up @@ -2803,8 +2803,8 @@ golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down Expand Up @@ -3164,8 +3164,8 @@ google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a/go.
google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:IBQ646DjkDkvUIsVq/cc03FUFQ9wbZu7yE396YcL870=
google.golang.org/genproto/googleapis/api v0.0.0-20231030173426-d783a09b4405/go.mod h1:oT32Z4o8Zv2xPQTg0pbVaPr0MPOH6f14RgXt7zfIpwg=
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4=
google.golang.org/genproto/googleapis/api v0.0.0-20240723171418-e6d459c13d2a h1:YIa/rzVqMEokBkPtydCkx1VLmv3An1Uw7w1P1m6EhOY=
google.golang.org/genproto/googleapis/api v0.0.0-20240723171418-e6d459c13d2a/go.mod h1:AHT0dDg3SoMOgZGnZk29b5xTbPHMoEC8qthmBLJCpys=
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8=
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo=
google.golang.org/genproto/googleapis/bytestream v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:ylj+BE99M198VPbBh6A8d9n3w8fChvyLK3wwBOjXBFA=
google.golang.org/genproto/googleapis/bytestream v0.0.0-20230807174057-1744710a1577/go.mod h1:NjCQG/D8JandXxM57PZbAJL1DCNL6EypA0vPPwfsc7c=
google.golang.org/genproto/googleapis/bytestream v0.0.0-20231030173426-d783a09b4405/go.mod h1:GRUCuLdzVqZte8+Dl/D4N25yLzcGqqWaYkeVOwulFqw=
Expand All @@ -3187,8 +3187,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a/go.
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:swOH3j0KzcDDgGUWr+SNpyTen5YrXjS3eyPzFYKc6lc=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405/go.mod h1:67X1fPuzjcrkymZzZV1vvkFeTn2Rvc6lYF9MYFGCcwE=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240723171418-e6d459c13d2a h1:hqK4+jJZXCU4pW7jsAdGOVFIfLHQeV7LaizZKnZ84HI=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240723171418-e6d459c13d2a/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1:e7S5W7MGGLaSu8j3YjdezkZ+m1/Nm0uRVRMEMGk26Xs=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
Expand Down
9 changes: 9 additions & 0 deletions internal/assets/migrations/004_signature.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- +migrate Up

ALTER TABLE deposits
ADD COLUMN signature text;

-- +migrate Down

ALTER TABLE deposits
DROP COLUMN signature;
29 changes: 0 additions & 29 deletions internal/bridge/processor/form_withdrawal.go

This file was deleted.

7 changes: 5 additions & 2 deletions internal/bridge/processor/get_deposit.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/pkg/errors"
)

func (p *Processor) ProcessGetDepositRequest(req bridgeTypes.GetDepositRequest) (data *bridgeTypes.FormWithdrawalRequest, reprocessable bool, err error) {
func (p *Processor) ProcessGetDepositRequest(req bridgeTypes.GetDepositRequest) (data *bridgeTypes.WithdrawalRequest, reprocessable bool, err error) {
defer func() { err = p.updateInvalidDepositStatus(err, reprocessable, req.DepositDbId) }()

proxy, err := p.proxies.Proxy(req.DepositIdentifier.ChainId)
Expand All @@ -24,6 +24,9 @@ func (p *Processor) ProcessGetDepositRequest(req bridgeTypes.GetDepositRequest)
if errors.Is(err, bridgeTypes.ErrTxFailed) ||
errors.Is(err, bridgeTypes.ErrDepositNotFound) ||
errors.Is(err, bridgeTypes.ErrInvalidDepositedAmount) ||
errors.Is(err, bridgeTypes.ErrUnsupportedEvent) ||
errors.Is(err, bridgeTypes.ErrFailedUnpackLogs) ||
errors.Is(err, bridgeTypes.ErrUnsupportedContract) ||
errors.Is(err, bridgeTypes.ErrInvalidScriptPubKey) {
reprocessable = false
}
Expand Down Expand Up @@ -74,7 +77,7 @@ func (p *Processor) ProcessGetDepositRequest(req bridgeTypes.GetDepositRequest)
return nil, true, errors.Wrap(err, "failed to save deposit data")
}

return &bridgeTypes.FormWithdrawalRequest{
return &bridgeTypes.WithdrawalRequest{
DepositDbId: req.DepositDbId,
Data: *depositData,
Destination: dstProxy.Type(),
Expand Down
46 changes: 0 additions & 46 deletions internal/bridge/processor/send_withdrawal.go

This file was deleted.

31 changes: 20 additions & 11 deletions internal/bridge/processor/sign_withdrawal.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,35 @@ package processor
import (
bridgeTypes "github.com/hyle-team/bridgeless-signer/internal/bridge/types"
"github.com/pkg/errors"
"math/big"
)

func (p *Processor) ProcessSignWithdrawalRequest(req bridgeTypes.WithdrawalRequest) (res *bridgeTypes.WithdrawalRequest, reprocessable bool, err error) {
func (p *Processor) ProcessSignWithdrawalRequest(req bridgeTypes.WithdrawalRequest) (res *bridgeTypes.SubmitTransactionRequest, reprocessable bool, err error) {
defer func() { err = p.updateInvalidDepositStatus(err, reprocessable, req.DepositDbId) }()

chainId, set := new(big.Int).SetString(req.Data.DestinationChainId, 10)
if !set {
return nil, false, errors.New("invalid destination chain id")
proxy, err := p.proxies.Proxy(req.Data.DestinationChainId)
if err != nil {
if errors.Is(err, bridgeTypes.ErrChainNotSupported) {
return nil, false, bridgeTypes.ErrChainNotSupported
}
return nil, true, errors.Wrap(err, "failed to get proxy")
}

signHash, err := proxy.GetSignHash(req.Data)
if err != nil {
return nil, true, errors.Wrap(err, "failed to form withdrawal transaction")
}

tx, err := p.signer.SignTx(req.Transaction, chainId)
signature, err := p.signer.SignMessage(signHash)
if err != nil {
// TODO: should be reprocessable or not?
return res, true, errors.Wrap(err, "failed to sign withdrawal transaction")
return nil, true, errors.Wrap(err, "failed to sign message")
}
req.Data.Signature = signature

if err = p.db.New().SetDepositSignature(req.Data); err != nil {
return nil, true, errors.Wrap(err, "failed to save signature data")
}

return &bridgeTypes.WithdrawalRequest{
Data: req.Data,
return &bridgeTypes.SubmitTransactionRequest{
DepositDbId: req.DepositDbId,
Transaction: tx,
}, false, nil
}
15 changes: 6 additions & 9 deletions internal/bridge/proxy/btc/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package btc

import (
"github.com/btcsuite/btcd/btcutil"
"github.com/ethereum/go-ethereum/core/types"
"github.com/hyle-team/bridgeless-signer/internal/bridge/chain"
bridgeTypes "github.com/hyle-team/bridgeless-signer/internal/bridge/types"
"github.com/hyle-team/bridgeless-signer/internal/data"
"gitlab.com/distributed_lab/logan/v3"
"regexp"
)

Expand All @@ -15,25 +15,22 @@ const minSatoshisPerOutput = 547
var txHashPattern = regexp.MustCompile("^[a-fA-F0-9]{64}$")

type proxy struct {
chain chain.Bitcoin
chain chain.Bitcoin
logger *logan.Entry
}

func NewBridgeProxy(ch chain.Bitcoin) bridgeTypes.Proxy {
return &proxy{chain: ch}
func NewBridgeProxy(ch chain.Bitcoin, logger *logan.Entry) bridgeTypes.Proxy {
return &proxy{chain: ch, logger: logger}
}

func (*proxy) Type() bridgeTypes.ChainType {
return bridgeTypes.ChainTypeBitcoin
}

func (p *proxy) FormWithdrawalTransaction(data data.DepositData) (*types.Transaction, error) {
func (p *proxy) GetSignHash(_ data.DepositData) ([]byte, error) {
return nil, bridgeTypes.ErrNotImplemented
}

func (p *proxy) SendWithdrawalTransaction(signedTx *types.Transaction) error {
return bridgeTypes.ErrNotImplemented
}

func (p *proxy) AddressValid(addr string) bool {
_, err := btcutil.DecodeAddress(addr, p.chain.Params)
return err == nil
Expand Down
Loading

0 comments on commit c99e3c7

Please sign in to comment.