Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
b65a7d4
refactor for next chain
Jan 13, 2026
36083b6
fix copilot comment
Jan 14, 2026
cde93b5
fix wrong test result
Jan 14, 2026
3e199c9
add xrpl
Jan 30, 2026
0053d4e
refactor
Jan 30, 2026
46ca388
add test
Jan 30, 2026
655cca6
fix metrics
Jan 30, 2026
c5d8c3b
fix copilot comment
Jan 31, 2026
034ea89
integrate with fkms
Feb 12, 2026
6955483
add some unit tests
Feb 12, 2026
c9c1eac
add wallet unit test
Feb 12, 2026
0363da0
fix lint
Feb 12, 2026
e470bc4
fix copilot comment
Feb 12, 2026
272fb91
fix copilot comment
Feb 20, 2026
2feb857
ignore stale updated time
Feb 23, 2026
95fde55
change proto payload
Feb 27, 2026
07f2e14
update proto
Mar 9, 2026
8d145ae
fix proto
Mar 12, 2026
5a3f357
fix tunnel relayer checking
Mar 12, 2026
cfa520a
delete family seed
Mar 12, 2026
94e507b
fix xprl client
Mar 12, 2026
3a56eba
delete comment
Mar 12, 2026
0677257
delete tunnel relayer metrics condition
Mar 12, 2026
0db4c6b
delete xprl timeout
Mar 12, 2026
d2dd686
fix default label
Mar 12, 2026
040d7c3
refactor load signers
Mar 12, 2026
298c5a8
fix unit test
Mar 12, 2026
4e2481b
add test for xrpl chain config
Mar 12, 2026
07f0d19
fix lint
Mar 12, 2026
80425f4
remove eof
Mar 12, 2026
40ecca9
[chore] Refactor to reduce duplicate between chain types (#73)
RogerKSI Mar 13, 2026
ff6f697
fix bug
RogerKSI Mar 14, 2026
f2af4f3
decode tss payload
Mar 15, 2026
6ac3078
evm signature condition
Mar 16, 2026
c61d5ca
remove useless uint convert
Mar 16, 2026
4d8a630
change query balance
Mar 16, 2026
de1fb49
fix copilot comment
Mar 16, 2026
4c55785
fix go convention
Mar 16, 2026
4712786
add client pool
RogerKSI Mar 16, 2026
86f2914
change key struct name
Mar 16, 2026
6a17ff8
query seq from db
Mar 16, 2026
cd87c1e
query db when xrpl
Mar 17, 2026
6f05137
fix ledger query and packet stale
Mar 17, 2026
c680fe2
fix alert call
Mar 17, 2026
9215849
fix get account sequence
Mar 17, 2026
e2a514d
validate xrpl signer
Mar 17, 2026
07f3902
combine function
Mar 17, 2026
163d337
add valid sender loop
Mar 18, 2026
156647d
record not found not err
Mar 18, 2026
b404359
fix interface
RogerKSI Mar 18, 2026
94fdc6e
Merge branch 'refactor-for-next-chain' of https://github.com/bandprot…
RogerKSI Mar 18, 2026
ed6ceb7
add padding
RogerKSI Mar 18, 2026
7536a22
fix comment
Mar 18, 2026
ddcd04d
save seqFloor instead of support contract
RogerKSI Mar 18, 2026
df49eb9
fix test
RogerKSI Mar 18, 2026
74f9746
fix fmtsprintf
Mar 18, 2026
1ca4d9e
return oracleID
Mar 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions cmd/chains.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/spf13/cobra"

"github.com/bandprotocol/falcon/relayer"
"github.com/bandprotocol/falcon/relayer/chains/evm"
)

// ChainsCmd returns a command that manages chain configurations.
Expand Down Expand Up @@ -119,13 +118,13 @@ chains list`),

i := 1
for chainName, chainProviderConfig := range cfg.TargetChains {
out := "%d: %s -> type(%s)"
switch cp := chainProviderConfig.(type) {
case *evm.EVMChainProviderConfig:
fmt.Fprintln(cmd.OutOrStdout(), fmt.Sprintf(out, i, chainName, cp.ChainType.String()))
default:
return fmt.Errorf("unsupported chain provider type for chain: %s", chainName)
}
fmt.Fprintf(
cmd.OutOrStdout(),
"%d: %s -> type(%v)\n",
i,
chainName,
chainProviderConfig.GetChainType(),
)
i++
}
return nil
Expand Down
31 changes: 27 additions & 4 deletions cmd/chains_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestChainsAdd(t *testing.T) {
require.NoError(t, res.Err)

chainCfgPath := path.Join(sys.HomeDir, "chain_config.toml")
err := os.WriteFile(chainCfgPath, []byte(relayertest.ChainCfgText), 0o600)
err := os.WriteFile(chainCfgPath, []byte(relayertest.EvmChainCfgText), 0o600)
require.NoError(t, err)

require.FileExists(t, chainCfgPath)
Expand All @@ -55,14 +55,37 @@ func TestChainsAdd(t *testing.T) {
require.Empty(t, res.Stderr.String())
}

func TestChainsAddXrpl(t *testing.T) {
sys := relayertest.NewSystem(t)

res := sys.RunWithInput(t, "config", "init")
require.NoError(t, res.Err)

chainCfgPath := path.Join(sys.HomeDir, "xrpl_chain_config.toml")
err := os.WriteFile(chainCfgPath, []byte(relayertest.XrplChainCfgText), 0o600)
require.NoError(t, err)

require.FileExists(t, chainCfgPath)

// Add chain
res = sys.RunWithInput(t, "chains", "add", "testnet_xrpl", chainCfgPath)
require.Empty(t, res.Stdout.String())
require.Empty(t, res.Stderr.String())

// List chains to check
res = sys.RunWithInput(t, "chains", "list")
require.Contains(t, res.Stdout.String(), "testnet_xrpl -> type(xrpl)")
require.Empty(t, res.Stderr.String())
}

func TestChainsDelete(t *testing.T) {
sys := relayertest.NewSystem(t)

res := sys.RunWithInput(t, "config", "init")
require.NoError(t, res.Err)

chainCfgPath := path.Join(sys.HomeDir, "chain_config.toml")
err := os.WriteFile(chainCfgPath, []byte(relayertest.ChainCfgText), 0o600)
err := os.WriteFile(chainCfgPath, []byte(relayertest.EvmChainCfgText), 0o600)
require.NoError(t, err)

require.FileExists(t, chainCfgPath)
Expand Down Expand Up @@ -103,7 +126,7 @@ func TestChainsShow(t *testing.T) {
require.NoError(t, res.Err)

chainCfgPath := path.Join(sys.HomeDir, "chain_config.toml")
err := os.WriteFile(chainCfgPath, []byte(relayertest.ChainCfgText), 0o600)
err := os.WriteFile(chainCfgPath, []byte(relayertest.EvmChainCfgText), 0o600)
require.NoError(t, err)

require.FileExists(t, chainCfgPath)
Expand All @@ -121,7 +144,7 @@ func TestChainsShow(t *testing.T) {
require.NoError(t, err)

var actualChainCfg map[string]interface{}
err = toml.Unmarshal([]byte(relayertest.ChainCfgText), &actualChainCfg)
err = toml.Unmarshal([]byte(relayertest.EvmChainCfgText), &actualChainCfg)
require.NoError(t, err)

require.Equal(t, expectedChainCfg, actualChainCfg)
Expand Down
22 changes: 11 additions & 11 deletions cmd/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/spf13/cobra"

"github.com/bandprotocol/falcon/relayer"
chainstypes "github.com/bandprotocol/falcon/relayer/chains/types"
"github.com/bandprotocol/falcon/relayer/types"
)

const (
Expand Down Expand Up @@ -38,8 +38,8 @@ type AddKeyInput struct {
// RemoteSignerInput is the input that holds the parameters needed to configure a remote signer.
type RemoteSignerInput struct {
Address string
Url string
Key *string
URL string
Key string
}

// KeysCmd represents the keys command
Expand Down Expand Up @@ -92,7 +92,7 @@ keys add eth test-key`),

// if no private key, mnemonic, or remote signer info is provided, prompt interactively
if input.PrivateKey == "" && input.Mnemonic == "" && input.RemoteSigner.Address == "" &&
input.RemoteSigner.Url == "" {
input.RemoteSigner.URL == "" {
input, err = showHuhPrompt()
if err != nil {
return err
Expand Down Expand Up @@ -280,7 +280,7 @@ keys show eth test-key`),
func validateAddKeyInput(input *AddKeyInput) error {
hasPrivateKey := input.PrivateKey != ""
hasMnemonic := input.Mnemonic != ""
hasRemoteSigner := input.RemoteSigner.Address != "" || input.RemoteSigner.Url != ""
hasRemoteSigner := input.RemoteSigner.Address != "" || input.RemoteSigner.URL != ""

// if a private key is provided, no other input should be present
if hasPrivateKey && (hasMnemonic || hasRemoteSigner) {
Expand All @@ -298,7 +298,7 @@ func validateAddKeyInput(input *AddKeyInput) error {
if input.RemoteSigner.Address == "" {
return fmt.Errorf("remote signer address cannot be empty")
}
if input.RemoteSigner.Url == "" {
if input.RemoteSigner.URL == "" {
return fmt.Errorf("remote signer URL cannot be empty")
}
}
Expand Down Expand Up @@ -459,7 +459,7 @@ func parseKeysAddInputFromFlag(cmd *cobra.Command) (*AddKeyInput, error) {
return nil, err
}

input.RemoteSigner.Url, err = cmd.Flags().GetString(flagRemoteUrl)
input.RemoteSigner.URL, err = cmd.Flags().GetString(flagRemoteUrl)
if err != nil {
return nil, err
}
Expand All @@ -469,7 +469,7 @@ func parseKeysAddInputFromFlag(cmd *cobra.Command) (*AddKeyInput, error) {
if err != nil {
return nil, err
}
input.RemoteSigner.Key = &remoteSignerKey
input.RemoteSigner.Key = remoteSignerKey
}

return input, nil
Expand All @@ -481,20 +481,20 @@ func addKey(
chainName string,
keyName string,
input *AddKeyInput,
) (*chainstypes.Key, error) {
) (*types.KeyOutput, error) {
if input == nil {
return nil, fmt.Errorf("invalid input: input is nil")
}

// Add key to the keychain
if input.PrivateKey != "" {
return app.AddKeyByPrivateKey(chainName, keyName, input.PrivateKey)
} else if input.RemoteSigner.Address != "" && input.RemoteSigner.Url != "" {
} else if input.RemoteSigner.Address != "" && input.RemoteSigner.URL != "" {
return app.AddRemoteSignerKey(
chainName,
keyName,
input.RemoteSigner.Address,
input.RemoteSigner.Url,
input.RemoteSigner.URL,
input.RemoteSigner.Key,
)
} else {
Expand Down
69 changes: 40 additions & 29 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
module github.com/bandprotocol/falcon

go 1.24.2
go 1.24.3
Comment thread
tanut32039 marked this conversation as resolved.

require (
cosmossdk.io/math v1.4.0
cosmossdk.io/x/tx v0.13.7
github.com/99designs/keyring v1.2.1
github.com/Peersyst/xrpl-go v0.1.14
github.com/bsv-blockchain/go-sdk v1.2.9
github.com/charmbracelet/huh v0.7.0
github.com/cometbft/cometbft v0.38.19
github.com/cosmos/cosmos-sdk v0.50.14
github.com/cometbft/cometbft v0.38.21
github.com/cosmos/cosmos-sdk v0.50.15
github.com/cosmos/gogoproto v1.7.0
github.com/ethereum/go-ethereum v1.16.2
github.com/ethereum/go-ethereum v1.17.0
github.com/joho/godotenv v1.5.1
github.com/jsternberg/zap-logfmt v1.3.0
github.com/miguelmota/go-ethereum-hdwallet v0.1.3
Expand All @@ -20,11 +23,12 @@ require (
github.com/spf13/cast v1.9.2
github.com/spf13/cobra v1.9.1
github.com/spf13/viper v1.20.1
github.com/stretchr/testify v1.10.0
github.com/stretchr/testify v1.11.1
go.uber.org/mock v0.6.0
go.uber.org/zap v1.27.0
google.golang.org/grpc v1.71.0
google.golang.org/protobuf v1.36.6
golang.org/x/crypto v0.44.0
google.golang.org/grpc v1.77.0
google.golang.org/protobuf v1.36.11
gorm.io/driver/postgres v1.6.0
gorm.io/driver/sqlite v1.6.0
gorm.io/gorm v1.30.1
Expand All @@ -38,11 +42,11 @@ require (
cosmossdk.io/errors v1.0.1 // indirect
cosmossdk.io/log v1.4.1 // indirect
cosmossdk.io/store v1.1.1 // indirect
filippo.io/edwards25519 v1.0.0 // indirect
filippo.io/edwards25519 v1.1.1 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.1 // indirect
github.com/DataDog/zstd v1.5.5 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6 // indirect
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/atotto/clipboard v0.1.4 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
Expand Down Expand Up @@ -70,45 +74,45 @@ require (
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/cometbft/cometbft-db v0.14.1 // indirect
github.com/consensys/gnark-crypto v0.18.0 // indirect
github.com/consensys/gnark-crypto v0.18.1 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/cosmos-db v1.1.1 // indirect
github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/iavl v1.2.2 // indirect
github.com/cosmos/ics23/go v0.11.0 // indirect
github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect
github.com/crate-crypto/go-eth-kzg v1.3.0 // indirect
github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect
github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/deckarep/golang-set/v2 v2.6.0 // indirect
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect
github.com/dgraph-io/badger/v4 v4.2.0 // indirect
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/dvsekhvalnov/jose2go v1.6.0 // indirect
github.com/dvsekhvalnov/jose2go v1.7.0 // indirect
github.com/emicklei/dot v1.6.2 // indirect
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
github.com/ethereum/c-kzg-4844/v2 v2.1.0 // indirect
github.com/ethereum/go-verkle v0.2.2 // indirect
github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/getsentry/sentry-go v0.27.0 // indirect
github.com/go-kit/kit v0.13.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
github.com/go-viper/mapstructure/v2 v2.3.0 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.2.4 // indirect
github.com/golang/glog v1.2.5 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/golang/snappy v1.0.0 // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/flatbuffers v1.12.1 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
Expand All @@ -126,6 +130,7 @@ require (
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
Expand All @@ -137,6 +142,8 @@ require (
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mattn/go-sqlite3 v1.14.22 // indirect
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
Expand All @@ -151,7 +158,7 @@ require (
github.com/prometheus/procfs v0.16.1 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/rogpeppe/go-internal v1.14.1 // indirect
github.com/rs/zerolog v1.33.0 // indirect
github.com/sagikazarmark/locafero v0.7.0 // indirect
github.com/sasha-s/go-deadlock v0.3.5 // indirect
Expand All @@ -160,29 +167,33 @@ require (
github.com/spf13/afero v1.12.0 // indirect
github.com/spf13/pflag v1.0.6 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/supranational/blst v0.3.14 // indirect
github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/tidwall/btree v1.7.0 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
github.com/zondax/hid v0.9.2 // indirect
github.com/zondax/ledger-go v0.14.3 // indirect
go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/otel v1.39.0 // indirect
go.opentelemetry.io/otel/metric v1.39.0 // indirect
go.opentelemetry.io/otel/trace v1.39.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
golang.org/x/crypto v0.38.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/net v0.40.0 // indirect
golang.org/x/sync v0.16.0 // indirect
golang.org/x/sys v0.33.0 // indirect
golang.org/x/term v0.32.0 // indirect
golang.org/x/text v0.25.0 // indirect
golang.org/x/net v0.47.0 // indirect
golang.org/x/sync v0.18.0 // indirect
golang.org/x/sys v0.39.0 // indirect
golang.org/x/term v0.37.0 // indirect
golang.org/x/text v0.31.0 // indirect
google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.5.1 // indirect
pgregory.net/rapid v1.1.0 // indirect
Expand Down
Loading
Loading