@@ -3,14 +3,10 @@ package changeset
3
3
import (
4
4
"encoding/json"
5
5
"fmt"
6
- "os"
7
- "strings"
8
6
"testing"
9
7
10
8
"github.com/stretchr/testify/require"
11
9
"go.uber.org/zap/zapcore"
12
- "golang.org/x/mod/modfile"
13
- "golang.org/x/mod/module"
14
10
15
11
"github.com/smartcontractkit/chainlink/deployment"
16
12
commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset"
@@ -20,69 +16,6 @@ import (
20
16
"github.com/smartcontractkit/chainlink/v2/core/logger"
21
17
)
22
18
23
- func init () {
24
- AssertAllContractsArePresent ()
25
- }
26
-
27
- func AssertAllContractsArePresent () {
28
- // list all contracts we'll expect to have
29
- expectedContracts := []string {
30
- "ccip_router.so" ,
31
- }
32
-
33
- // check if all contracts are present in the correct path
34
- programsPath := memory .GetProgramsPath ()
35
-
36
- // check if all contracts are present
37
- for _ , contract := range expectedContracts {
38
- contractPath := fmt .Sprintf ("%s/%s" , programsPath , contract )
39
-
40
- _ , err := os .Stat (contractPath )
41
-
42
- if err != nil {
43
- panic (fmt .Sprintf ("Contract %s not found in %s. Please run script TODO to populate them" , contract , contractPath ))
44
- }
45
- }
46
-
47
- // read current version of contracts and compare with expected
48
- currentContractsRevision , err := os .ReadFile (programsPath + "/.solana_contracts_rev" )
49
- currentContractsRevision = []byte (strings .TrimSpace (string (currentContractsRevision )))
50
- if err != nil {
51
- panic (fmt .Sprintf ("Could not read .solana_contracts_rev file: %v" , err ))
52
- }
53
-
54
- gomodContent , err := os .ReadFile ("../../../deployment/go.mod" )
55
- if err != nil {
56
- panic (fmt .Sprintf ("Could not read deployment/go.mod file: %v" , err ))
57
- }
58
-
59
- modfile , err := modfile .Parse ("deployment/go.mod" , gomodContent , nil )
60
- if err != nil {
61
- panic (fmt .Sprintf ("Could not parse deployment/go.mod file: %v" , err ))
62
- }
63
-
64
- var solanaModVersion string = ""
65
- for _ , r := range modfile .Require {
66
- if r .Mod .Path == "github.com/smartcontractkit/chainlink-ccip/chains/solana" {
67
- solanaModVersion = r .Mod .Version
68
- break
69
- }
70
- }
71
- if solanaModVersion == "" {
72
- panic ("Could not find ccip solana module in deployment/go.mod" )
73
- }
74
-
75
- solanaModVersionRev , err := module .PseudoVersionRev (solanaModVersion )
76
-
77
- if err != nil {
78
- panic (fmt .Sprintf ("Could not parse ccip solana module version: %v" , err ))
79
- }
80
-
81
- if string (currentContractsRevision ) != solanaModVersionRev {
82
- panic (fmt .Sprintf ("solana_contracts_rev file is outdated. Please run script TODO to update it" ))
83
- }
84
- }
85
-
86
19
func TestDeployChainContractsChangeset (t * testing.T ) {
87
20
t .Parallel ()
88
21
lggr := logger .TestLogger (t )
0 commit comments