Skip to content
Draft
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
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ updates:
- dependency-name: "github.com/ethereum/go-ethereum"
- dependency-name: "github.com/gagliardetto/solana-go"
- dependency-name: "github.com/stellar/go-stellar-sdk"
- dependency-name: "github.com/smartcontractkit/chainlink-stellar/bindings"
- package-ecosystem: npm
directory: "/"
schedule:
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/go-mod-validation.yml

This file was deleted.

7 changes: 6 additions & 1 deletion .github/workflows/pull-request-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,16 @@ jobs:
CTF_CONFIGS=../config.sui.toml go test -p=1 -tags=e2e -v ./e2e/tests/... -run=TestSuiSuite || sui_failure=true
echo "::endgroup::"

echo "::group::Stellar"
CTF_CONFIGS=../config.stellar.toml go test -p=1 -tags=e2e -v ./e2e/tests/... -run=TestStellarSuite || stellar_failure=true
echo "::endgroup::"

[[ -n "${evm_failure}" ]] && echo "🚨 EVM e2e tests failed."
[[ -n "${solana_failure}" ]] && echo "🚨 Solana e2e tests failed."
[[ -n "${aptos_failure}" ]] && echo "🚨 Aptos e2e tests failed."
[[ -n "${sui_failure}" ]] && echo "🚨 Sui e2e tests failed."
[[ -n "${evm_failure}" || -n "${solana_failure}" || -n "${aptos_failure}" || -n "${sui_failure}" ]] && {
[[ -n "${stellar_failure}" ]] && echo "🚨 Stellar e2e tests failed."
[[ -n "${evm_failure}" || -n "${solana_failure}" || -n "${aptos_failure}" || -n "${sui_failure}" || -n "${stellar_failure}" ]] && {
exit 1
} || {
echo "Exiting"
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/push-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,16 @@ jobs:
CTF_CONFIGS=../config.sui.toml go test -p=1 -tags=e2e -v ./e2e/tests/... -run=TestSuiSuite || sui_failure=true
echo "::endgroup::"

echo "::group::Stellar"
CTF_CONFIGS=../config.stellar.toml go test -p=1 -tags=e2e -v ./e2e/tests/... -run=TestStellarSuite || stellar_failure=true
echo "::endgroup::"

[[ -n "${evm_failure}" ]] && echo "🚨 EVM e2e tests failed."
[[ -n "${solana_failure}" ]] && echo "🚨 Solana e2e tests failed."
[[ -n "${aptos_failure}" ]] && echo "🚨 Aptos e2e tests failed."
[[ -n "${sui_failure}" ]] && echo "🚨 Sui e2e tests failed."
[[ -n "${evm_failure}" || -n "${solana_failure}" || -n "${aptos_failure}" || -n "${sui_failure}" ]] && {
[[ -n "${stellar_failure}" ]] && echo "🚨 Stellar e2e tests failed."
[[ -n "${evm_failure}" || -n "${solana_failure}" || -n "${aptos_failure}" || -n "${sui_failure}" || -n "${stellar_failure}" ]] && {
exit 1
} || {
echo "Exiting"
Expand Down
3 changes: 3 additions & 0 deletions chainwrappers/chainaccessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"github.com/xssnick/tonutils-go/ton"
tonwallet "github.com/xssnick/tonutils-go/ton/wallet"

stellarbindings "github.com/smartcontractkit/chainlink-stellar/bindings"

Check failure on line 11 in chainwrappers/chainaccessor.go

View workflow job for this annotation

GitHub Actions / Tests E2E

github.com/smartcontractkit/chainlink-stellar/bindings@v0.0.0-20260505155616-666b86bf48b9: replacement directory ../chainlink-stellar/bindings does not exist

Check failure on line 11 in chainwrappers/chainaccessor.go

View workflow job for this annotation

GitHub Actions / Tests E2E

github.com/smartcontractkit/chainlink-stellar/bindings@v0.0.0-20260505155616-666b86bf48b9: replacement directory ../chainlink-stellar/bindings does not exist

Check failure on line 11 in chainwrappers/chainaccessor.go

View workflow job for this annotation

GitHub Actions / Tests E2E

github.com/smartcontractkit/chainlink-stellar/bindings@v0.0.0-20260505155616-666b86bf48b9: replacement directory ../chainlink-stellar/bindings does not exist

Check failure on line 11 in chainwrappers/chainaccessor.go

View workflow job for this annotation

GitHub Actions / Tests E2E

github.com/smartcontractkit/chainlink-stellar/bindings@v0.0.0-20260505155616-666b86bf48b9: replacement directory ../chainlink-stellar/bindings does not exist

Check failure on line 11 in chainwrappers/chainaccessor.go

View workflow job for this annotation

GitHub Actions / Tests

github.com/smartcontractkit/chainlink-stellar/bindings@v0.0.0-20260505155616-666b86bf48b9: replacement directory ../chainlink-stellar/bindings does not exist

Check failure on line 11 in chainwrappers/chainaccessor.go

View workflow job for this annotation

GitHub Actions / Tests

github.com/smartcontractkit/chainlink-stellar/bindings@v0.0.0-20260505155616-666b86bf48b9: replacement directory ../chainlink-stellar/bindings does not exist

Check failure on line 11 in chainwrappers/chainaccessor.go

View workflow job for this annotation

GitHub Actions / Tests

github.com/smartcontractkit/chainlink-stellar/bindings@v0.0.0-20260505155616-666b86bf48b9: replacement directory ../chainlink-stellar/bindings does not exist

Check failure on line 11 in chainwrappers/chainaccessor.go

View workflow job for this annotation

GitHub Actions / Tests

github.com/smartcontractkit/chainlink-stellar/bindings@v0.0.0-20260505155616-666b86bf48b9: replacement directory ../chainlink-stellar/bindings does not exist

Check failure on line 11 in chainwrappers/chainaccessor.go

View workflow job for this annotation

GitHub Actions / Tests E2E - Nix setup

github.com/smartcontractkit/chainlink-stellar/bindings@v0.0.0-20260505155616-666b86bf48b9: replacement directory ../chainlink-stellar/bindings does not exist

Check failure on line 11 in chainwrappers/chainaccessor.go

View workflow job for this annotation

GitHub Actions / Tests E2E - Nix setup

github.com/smartcontractkit/chainlink-stellar/bindings@v0.0.0-20260505155616-666b86bf48b9: replacement directory ../chainlink-stellar/bindings does not exist

Check failure on line 11 in chainwrappers/chainaccessor.go

View workflow job for this annotation

GitHub Actions / Tests E2E - Nix setup

github.com/smartcontractkit/chainlink-stellar/bindings@v0.0.0-20260505155616-666b86bf48b9: replacement directory ../chainlink-stellar/bindings does not exist

Check failure on line 11 in chainwrappers/chainaccessor.go

View workflow job for this annotation

GitHub Actions / Tests E2E - Nix setup

github.com/smartcontractkit/chainlink-stellar/bindings@v0.0.0-20260505155616-666b86bf48b9: replacement directory ../chainlink-stellar/bindings does not exist

evmsdk "github.com/smartcontractkit/mcms/sdk/evm"
suisuisdk "github.com/smartcontractkit/mcms/sdk/sui"
)
Expand All @@ -24,4 +26,5 @@
SuiSigner(selector uint64) (suisuisdk.SuiSigner, bool)
TonClient(selector uint64) (ton.APIClientWrapped, bool)
TonSigner(selector uint64) (*tonwallet.Wallet, bool)
StellarInvoker(selector uint64) (stellarbindings.Invoker, bool)
}
3 changes: 3 additions & 0 deletions chainwrappers/converters.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/smartcontractkit/mcms/sdk/aptos"
"github.com/smartcontractkit/mcms/sdk/evm"
"github.com/smartcontractkit/mcms/sdk/solana"
"github.com/smartcontractkit/mcms/sdk/stellar"
"github.com/smartcontractkit/mcms/sdk/sui"
"github.com/smartcontractkit/mcms/sdk/ton"
"github.com/smartcontractkit/mcms/types"
Expand Down Expand Up @@ -51,6 +52,8 @@ func BuildConverter(selector types.ChainSelector, metadata types.ChainMetadata)
converter, _ = sui.NewTimelockConverter()
case chainsel.FamilyTon:
converter = ton.NewTimelockConverter(ton.DefaultSendAmount)
case chainsel.FamilyStellar:
converter = stellar.NewTimelockConverter()
default:
return nil, fmt.Errorf("unsupported chain family %s", fam)
}
Expand Down
3 changes: 3 additions & 0 deletions chainwrappers/converters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/smartcontractkit/mcms/sdk/aptos"
"github.com/smartcontractkit/mcms/sdk/evm"
"github.com/smartcontractkit/mcms/sdk/solana"
"github.com/smartcontractkit/mcms/sdk/stellar"
"github.com/smartcontractkit/mcms/sdk/sui"
"github.com/smartcontractkit/mcms/sdk/ton"
"github.com/smartcontractkit/mcms/types"
Expand All @@ -31,13 +32,15 @@ func TestBuildConverters(t *testing.T) {
chaintest.Chain5Selector: {},
chaintest.Chain6Selector: {},
chaintest.Chain7Selector: {},
chaintest.Chain9Selector: {},
},
expectTypes: map[types.ChainSelector]any{
chaintest.Chain2Selector: (*evm.TimelockConverter)(nil),
chaintest.Chain4Selector: (*solana.TimelockConverter)(nil),
chaintest.Chain5Selector: (*aptos.TimelockConverter)(nil),
chaintest.Chain6Selector: (*sui.TimelockConverter)(nil),
chaintest.Chain7Selector: (*ton.TimelockConverter)(nil),
chaintest.Chain9Selector: (*stellar.TimelockConverter)(nil),
},
},
{
Expand Down
13 changes: 13 additions & 0 deletions chainwrappers/executors.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/smartcontractkit/mcms/sdk/aptos"
"github.com/smartcontractkit/mcms/sdk/evm"
"github.com/smartcontractkit/mcms/sdk/solana"
"github.com/smartcontractkit/mcms/sdk/stellar"
"github.com/smartcontractkit/mcms/sdk/sui"
"github.com/smartcontractkit/mcms/sdk/ton"
"github.com/smartcontractkit/mcms/types"
Expand Down Expand Up @@ -167,6 +168,18 @@ func BuildExecutor(
Amount: ton.DefaultSendAmount,
})

case chainsel.FamilyStellar:
stellarEncoder, ok := encoder.(*stellar.Encoder)
if !ok {
return nil, fmt.Errorf("invalid encoder type for selector %d: %T", chainSelector, encoder)
}
invoker, ok := chains.StellarInvoker(rawSelector)
if !ok {
return nil, fmt.Errorf("missing stellar invoker for selector %d", chainSelector)
}

return stellar.NewExecutor(stellarEncoder, invoker), nil

default:
return nil, fmt.Errorf("unsupported chain family %s", family)
}
Expand Down
40 changes: 34 additions & 6 deletions chainwrappers/executors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,37 @@ import (
sol "github.com/gagliardetto/solana-go"
solrpc "github.com/gagliardetto/solana-go/rpc"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
chainsel "github.com/smartcontractkit/chain-selectors"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
tonwallet "github.com/xssnick/tonutils-go/ton/wallet"

"github.com/smartcontractkit/mcms/chainwrappers/mocks"
"github.com/smartcontractkit/mcms/internal/testutils/chaintest"
mcmssdk "github.com/smartcontractkit/mcms/sdk"
"github.com/smartcontractkit/mcms/sdk/aptos"
aptosmocks "github.com/smartcontractkit/mcms/sdk/aptos/mocks/aptos"
"github.com/smartcontractkit/mcms/sdk/evm"
"github.com/smartcontractkit/mcms/sdk/solana"
"github.com/smartcontractkit/mcms/sdk/stellar"
"github.com/smartcontractkit/mcms/sdk/sui"
suibindmocks "github.com/smartcontractkit/mcms/sdk/sui/mocks/bindutils"
suimocks "github.com/smartcontractkit/mcms/sdk/sui/mocks/sui"
"github.com/smartcontractkit/mcms/sdk/ton"
tonmocks "github.com/smartcontractkit/mcms/sdk/ton/mocks"
mcmstypes "github.com/smartcontractkit/mcms/types"

stellarbindings "github.com/smartcontractkit/chainlink-stellar/bindings"
)

var (
evmSelector = mcmstypes.ChainSelector(chainsel.ETHEREUM_TESTNET_SEPOLIA.Selector)
solSelector = mcmstypes.ChainSelector(chainsel.SOLANA_DEVNET.Selector)
aptosSelector = mcmstypes.ChainSelector(chainsel.APTOS_TESTNET.Selector)
suiSelector = mcmstypes.ChainSelector(chainsel.SUI_TESTNET.Selector)
tonSelector = mcmstypes.ChainSelector(chainsel.TON_TESTNET.Selector)
evmSelector = mcmstypes.ChainSelector(chainsel.ETHEREUM_TESTNET_SEPOLIA.Selector)
solSelector = mcmstypes.ChainSelector(chainsel.SOLANA_DEVNET.Selector)
aptosSelector = mcmstypes.ChainSelector(chainsel.APTOS_TESTNET.Selector)
suiSelector = mcmstypes.ChainSelector(chainsel.SUI_TESTNET.Selector)
tonSelector = mcmstypes.ChainSelector(chainsel.TON_TESTNET.Selector)
stellarSelector = chaintest.Chain9Selector
)

func TestBuildExecutors(t *testing.T) {
Expand Down Expand Up @@ -66,6 +72,10 @@ func TestBuildExecutors(t *testing.T) {
tonExecutor, err := ton.NewExecutor(tonExecOpts)
require.NoError(t, err)

stellarEncoder := stellar.NewEncoder(stellarSelector, 0, false)
var stellarInvoker stellarbindings.Invoker
stellarExecutor := stellar.NewExecutor(stellarEncoder, stellarInvoker)

tests := []struct {
name string
encoders map[mcmstypes.ChainSelector]mcmssdk.Encoder
Expand Down Expand Up @@ -154,6 +164,24 @@ func TestBuildExecutors(t *testing.T) {
aptosSelector: aptosCurseExecutor,
},
},
{
name: "success with stellar",
encoders: map[mcmstypes.ChainSelector]mcmssdk.Encoder{
stellarSelector: stellarEncoder,
},
chainMetadata: map[mcmstypes.ChainSelector]mcmstypes.ChainMetadata{
stellarSelector: {
MCMAddress: "0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20",
StartingOpCount: 0,
},
},
setup: func(accessor *mocks.ChainAccessor) {
accessor.EXPECT().StellarInvoker(mock.Anything).Return(stellarInvoker, true)
},
want: map[mcmstypes.ChainSelector]mcmssdk.Executor{
stellarSelector: stellarExecutor,
},
},
}

for _, tt := range tests {
Expand All @@ -166,7 +194,7 @@ func TestBuildExecutors(t *testing.T) {
got, err := BuildExecutors(chainAccessor, tt.chainMetadata, tt.encoders, mcmstypes.TimelockActionSchedule)
if tt.wantErr == "" {
require.NoError(t, err)
require.Empty(t, cmp.Diff(tt.want, got))
require.Empty(t, cmp.Diff(tt.want, got, cmpopts.IgnoreUnexported(stellar.Executor{}, stellar.Inspector{})))
} else {
require.ErrorContains(t, err, tt.wantErr)
}
Expand Down
10 changes: 10 additions & 0 deletions chainwrappers/inspectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/smartcontractkit/mcms/sdk/aptos"
"github.com/smartcontractkit/mcms/sdk/evm"
"github.com/smartcontractkit/mcms/sdk/solana"
"github.com/smartcontractkit/mcms/sdk/stellar"
"github.com/smartcontractkit/mcms/sdk/sui"
"github.com/smartcontractkit/mcms/sdk/ton"
"github.com/smartcontractkit/mcms/types"
Expand Down Expand Up @@ -103,6 +104,15 @@ func BuildInspector(
}

return ton.NewInspector(client), nil

case chainsel.FamilyStellar:
invoker, ok := chains.StellarInvoker(rawSelector)
if !ok {
return nil, fmt.Errorf("missing stellar invoker for selector %d", rawSelector)
}

return stellar.NewInspector(invoker), nil

default:
return nil, fmt.Errorf("unsupported chain family %s", family)
}
Expand Down
7 changes: 6 additions & 1 deletion chainwrappers/inspectors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ func TestMCMInspectorBuilder_BuildInspectors(t *testing.T) {
mcmsTypes.ChainSelector(chainsel.SOLANA_DEVNET.Selector): {MCMAddress: "0xsolana", StartingOpCount: 0},
mcmsTypes.ChainSelector(chainsel.APTOS_TESTNET.Selector): {MCMAddress: "0xaptos", StartingOpCount: 0},
mcmsTypes.ChainSelector(chainsel.TON_TESTNET.Selector): {MCMAddress: "0xton", StartingOpCount: 0},
mcmsTypes.ChainSelector(chainsel.STELLAR_TESTNET.Selector): {
MCMAddress: "0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20",
StartingOpCount: 0,
},
mcmsTypes.ChainSelector(chainsel.SUI_TESTNET.Selector): {
MCMAddress: "0xsui",
StartingOpCount: 0,
Expand All @@ -70,8 +74,9 @@ func TestMCMInspectorBuilder_BuildInspectors(t *testing.T) {
access.EXPECT().SuiClient(mock.Anything).Return(nil, true)
access.EXPECT().SuiSigner(mock.Anything).Return(nil, true)
access.EXPECT().TonClient(mock.Anything).Return(nil, true)
access.EXPECT().StellarInvoker(mock.Anything).Return(nil, true)
},
expectedInspectorsCount: 5,
expectedInspectorsCount: 6,
},
{
name: "aptos curse mcms from metadata",
Expand Down
74 changes: 63 additions & 11 deletions chainwrappers/mocks/chain_accessor.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading