Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 4 additions & 3 deletions chains/evm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/mitchellh/mapstructure"

solverConfig "github.com/sprintertech/solver-config/go/config"
"github.com/sprintertech/solver-sdk/pkg/chains/caip"
"github.com/sprintertech/sprinter-signing/config"
"github.com/sprintertech/sprinter-signing/config/chain"
)
Expand Down Expand Up @@ -76,7 +77,7 @@ func NewEVMConfig(chainConfig map[string]interface{}, solverConfig solverConfig.
return nil, err
}

id := fmt.Sprintf("eip155:%d", *c.Id)
id := caip.ChainIDToCAIP(*c.Id, caip.NamespaceForChainID(*c.Id))
sc, ok := solverConfig.Chains[id]
if !ok {
return nil, fmt.Errorf("no solver config for id %s", id)
Expand Down Expand Up @@ -125,8 +126,8 @@ func NewEVMConfig(chainConfig map[string]interface{}, solverConfig solverConfig.
Processors: processors,
AcrossPool: solverConfig.ProtocolsMetadata.Across.SpokePools[id],
AcrossHubPool: solverConfig.ProtocolsMetadata.Across.HubPools[id],
LifiOutputSettler: solverConfig.ProtocolsMetadata.Lifi.OutputSettler,
LifiInputSettlerEscrow: solverConfig.ProtocolsMetadata.Lifi.InputSettlerEscrow,
LifiOutputSettler: solverConfig.ProtocolsMetadata.Lifi.OutputSettlers[id],
LifiInputSettlerEscrow: solverConfig.ProtocolsMetadata.Lifi.InputSettlerEscrows[id],
Liquidators: liquidators,

// nolint:gosec
Expand Down
42 changes: 26 additions & 16 deletions chains/evm/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,12 @@ func (s *NewEVMConfigTestSuite) Test_ValidConfig() {
},
},
Lifi: &solverConfig.LifiMetadata{
OutputSettler: "settler",
InputSettlerEscrow: "escrowSettler",
OutputSettlers: map[string]string{
"eip155:1": "settler",
},
InputSettlerEscrows: map[string]string{
"eip155:1": "escrowSettler",
},
},
SprinterCredit: map[string][]solverConfig.SprinterCredit{
"eip155:1": {
Expand Down Expand Up @@ -231,10 +235,15 @@ func (s *NewEVMConfigTestSuite) Test_ValidConfigWithCustomTxParams() {
},
},
Lifi: &solverConfig.LifiMetadata{
OutputSettler: "settler",
OutputSettlers: map[string]string{
"eip155:1": "settler",
},
InputSettlerEscrows: map[string]string{
"eip155:1": "escrow",
},
RepaymentProcessors: map[string]map[string]solverConfig.RepaymentProcessor{
"eip155:1": map[string]solverConfig.RepaymentProcessor{
"uSdC": solverConfig.RepaymentProcessor{
"eip155:1": {
"uSdC": {
Address: "0xdBBE3D8c2d2b22A2611c5A94A9a12C2fCD49Eb28",
},
},
Expand All @@ -256,16 +265,17 @@ func (s *NewEVMConfigTestSuite) Test_ValidConfigWithCustomTxParams() {
BlockConfirmations: 5,
Blocktime: 2,
},
BlockInterval: big.NewInt(2),
BlockRetryInterval: time.Duration(10) * time.Second,
Admin: "adminAddress",
AcrossPool: "acrossPool",
AcrossHubPool: "acrossHubPool",
LifiOutputSettler: "settler",
Repayer: "repayer",
ConfirmationsByValue: expectedBlockConfirmations,
Tokens: expectedTokens,
Processors: processors,
Liquidators: make(map[common.Address]common.Address),
BlockInterval: big.NewInt(2),
BlockRetryInterval: time.Duration(10) * time.Second,
Admin: "adminAddress",
AcrossPool: "acrossPool",
AcrossHubPool: "acrossHubPool",
LifiOutputSettler: "settler",
LifiInputSettlerEscrow: "escrow",
Repayer: "repayer",
ConfirmationsByValue: expectedBlockConfirmations,
Tokens: expectedTokens,
Processors: processors,
Liquidators: make(map[common.Address]common.Address),
})
}
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ require (
github.com/rs/zerolog v1.25.0
github.com/spf13/cobra v1.10.2
github.com/spf13/viper v1.9.0
github.com/sprintertech/solver-config/go v0.0.0-20260819115035-7b1b83250ca4
github.com/sprintertech/solver-sdk v1.1.1-0.20260827154133-1e8cff30b44b
github.com/sprintertech/solver-config/go v0.0.0-20260901094026-b84bd6a9b33c
github.com/sprintertech/solver-sdk v1.1.1-0.20260901143229-178cc52472b7
github.com/stretchr/testify v1.11.1
github.com/sygmaprotocol/sygma-core v0.0.0-20250304150334-bd39ac4f7b82
go.opentelemetry.io/otel v1.39.0
Expand Down
14 changes: 4 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1713,16 +1713,10 @@ github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/y
github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns=
github.com/spf13/viper v1.9.0 h1:yR6EXjTp0y0cLN8OZg1CRZmOBdI88UcGkhgyJhu6nZk=
github.com/spf13/viper v1.9.0/go.mod h1:+i6ajR7OX2XaiBkrcZJFK21htRk7eDeLg7+O6bhUPP4=
github.com/sprintertech/solver-config/go v0.0.0-20260811202645-859c642937f6 h1:SiLvJC8vyMNWbQgqGdd7Z5WP2Jg7XFShXN130ryqCgM=
github.com/sprintertech/solver-config/go v0.0.0-20260811202645-859c642937f6/go.mod h1:MrIGW6M815PSYKtWSeOd1Z7eiSeOIk/uA/6E2PhlQVQ=
github.com/sprintertech/solver-config/go v0.0.0-20260819115035-7b1b83250ca4 h1:ouDxcEePolYizXXKjeB61jawFmDJrBeJg7l4MSnQeck=
github.com/sprintertech/solver-config/go v0.0.0-20260819115035-7b1b83250ca4/go.mod h1:MrIGW6M815PSYKtWSeOd1Z7eiSeOIk/uA/6E2PhlQVQ=
github.com/sprintertech/solver-sdk v1.1.1-0.20260821104752-6a3c113a5958 h1:++m9ZfqDmqx2ieyP76h/snKFRVhl2TUPJ7qavLz1JiU=
github.com/sprintertech/solver-sdk v1.1.1-0.20260821104752-6a3c113a5958/go.mod h1:6euNIW0DgGI/RfIvpZJgnvoVcd1PmzE1T20C0dXnyrc=
github.com/sprintertech/solver-sdk v1.1.1-0.20260825101026-32c00a9704e6 h1:0bfmInjG3+ak7E65LVBVOQxArztBSZw49iNY9dpfS8I=
github.com/sprintertech/solver-sdk v1.1.1-0.20260825101026-32c00a9704e6/go.mod h1:A9fQAvneC86+z0ib2cb+yTOV84olOqcBZxomj1pe3bc=
github.com/sprintertech/solver-sdk v1.1.1-0.20260827154133-1e8cff30b44b h1:Xfr0QWclvoL0OGtjMrFTxoDU66JQHwBR8u1LdRYLba8=
github.com/sprintertech/solver-sdk v1.1.1-0.20260827154133-1e8cff30b44b/go.mod h1:A9fQAvneC86+z0ib2cb+yTOV84olOqcBZxomj1pe3bc=
github.com/sprintertech/solver-config/go v0.0.0-20260901094026-b84bd6a9b33c h1:qoZkN8WQ1UGE2c409EpafONb+HwpilrsXsKfYNHM/h0=
github.com/sprintertech/solver-config/go v0.0.0-20260901094026-b84bd6a9b33c/go.mod h1:MrIGW6M815PSYKtWSeOd1Z7eiSeOIk/uA/6E2PhlQVQ=
github.com/sprintertech/solver-sdk v1.1.1-0.20260901143229-178cc52472b7 h1:4p2gaKMNVCROeNlab2WBZYTemOkganPraqTypvOsNZU=
github.com/sprintertech/solver-sdk v1.1.1-0.20260901143229-178cc52472b7/go.mod h1:wssz0/TVHrUGBpR8CQt9uqXg+Dz+oKQeKKTWRvfO0BQ=
github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
Loading