diff --git a/core/config/docs/chains-starknet.toml b/core/config/docs/chains-starknet.toml index 306876a0f66..4ea2647a72d 100644 --- a/core/config/docs/chains-starknet.toml +++ b/core/config/docs/chains-starknet.toml @@ -22,4 +22,4 @@ Name = 'primary' # Example # URL is the base HTTP(S) endpoint for this node. URL = 'http://stark.node' # Example # APIKey Header is optional and only required for Nethermind RPCs -APIKey = 'key' # Example \ No newline at end of file +APIKey = 'key' # Example diff --git a/core/services/chainlink/config_test.go b/core/services/chainlink/config_test.go index 72efea38f85..6b449137f91 100644 --- a/core/services/chainlink/config_test.go +++ b/core/services/chainlink/config_test.go @@ -1138,12 +1138,6 @@ CertFile = '/path/to/cert.pem' t.Run(tt.name, func(t *testing.T) { s, err := tt.config.TOMLString() require.NoError(t, err) - - // parsing from TOML requires stripping new lines - if tt.name == "full" || tt.name == "multi-chain" { - s = strings.TrimRight(s, "\n") - } - assert.Equal(t, tt.exp, s, diff.Diff(tt.exp, s)) var got Config @@ -1370,7 +1364,7 @@ func Test_generalConfig_LogConfiguration(t *testing.T) { if assert.Len(t, inputLogs, 1) { assert.Equal(t, zapcore.InfoLevel, inputLogs[0].Level) got := strings.TrimPrefix(inputLogs[0].Message, secrets) - got = strings.TrimRight(got, "\n") + got = strings.TrimSuffix(got, "\n") assert.Equal(t, tt.wantSecrets, got) } @@ -1378,7 +1372,7 @@ func Test_generalConfig_LogConfiguration(t *testing.T) { if assert.Len(t, inputLogs, 1) { assert.Equal(t, zapcore.InfoLevel, inputLogs[0].Level) got := strings.TrimPrefix(inputLogs[0].Message, input) - got = strings.TrimRight(got, "\n") + got = strings.TrimSuffix(got, "\n") assert.Equal(t, tt.wantConfig, got) } @@ -1386,7 +1380,7 @@ func Test_generalConfig_LogConfiguration(t *testing.T) { if assert.Len(t, inputLogs, 1) { assert.Equal(t, zapcore.InfoLevel, inputLogs[0].Level) got := strings.TrimPrefix(inputLogs[0].Message, effective) - got = strings.TrimRight(got, "\n") + got = strings.TrimSuffix(got, "\n") assert.Equal(t, tt.wantEffective, got) } @@ -1394,7 +1388,7 @@ func Test_generalConfig_LogConfiguration(t *testing.T) { if tt.wantWarning != "" && assert.Len(t, inputLogs, 1) { assert.Equal(t, zapcore.WarnLevel, inputLogs[0].Level) got := strings.TrimPrefix(inputLogs[0].Message, warning) - got = strings.TrimRight(got, "\n") + got = strings.TrimSuffix(got, "\n") assert.Equal(t, tt.wantWarning, got) } }) @@ -1556,7 +1550,7 @@ func TestConfig_SetFrom(t *testing.T) { require.NoError(t, c.SetFrom(&f)) } ts, err := c.TOMLString() - ts = strings.TrimRight(ts, "\n") + ts = strings.TrimSuffix(ts, "\n") require.NoError(t, err) assert.Equal(t, tt.exp, ts) }) diff --git a/core/services/chainlink/testdata/config-empty-effective.toml b/core/services/chainlink/testdata/config-empty-effective.toml index d6a1ea4114d..f1b3ef56514 100644 --- a/core/services/chainlink/testdata/config-empty-effective.toml +++ b/core/services/chainlink/testdata/config-empty-effective.toml @@ -243,4 +243,4 @@ AnnounceAddresses = [] DefaultBootstrappers = [] DeltaDial = '15s' DeltaReconcile = '1m0s' -ListenAddresses = [] \ No newline at end of file +ListenAddresses = [] diff --git a/core/services/chainlink/testdata/config-full.toml b/core/services/chainlink/testdata/config-full.toml index dc789281f45..95802caf360 100644 --- a/core/services/chainlink/testdata/config-full.toml +++ b/core/services/chainlink/testdata/config-full.toml @@ -441,4 +441,4 @@ ConfirmationPoll = '42s' [[Starknet.Nodes]] Name = 'primary' URL = 'http://stark.node' -APIKey = 'key' \ No newline at end of file +APIKey = 'key' diff --git a/core/services/chainlink/testdata/config-multi-chain-effective.toml b/core/services/chainlink/testdata/config-multi-chain-effective.toml index c7ecbf93139..fc4dce01ef2 100644 --- a/core/services/chainlink/testdata/config-multi-chain-effective.toml +++ b/core/services/chainlink/testdata/config-multi-chain-effective.toml @@ -596,4 +596,4 @@ ConfirmationPoll = '1h0m0s' [[Starknet.Nodes]] Name = 'primary' URL = 'http://stark.node' -APIKey = 'key' \ No newline at end of file +APIKey = 'key' diff --git a/core/services/chainlink/testdata/config-multi-chain.toml b/core/services/chainlink/testdata/config-multi-chain.toml index 9d29e8e6d37..e45255a4373 100644 --- a/core/services/chainlink/testdata/config-multi-chain.toml +++ b/core/services/chainlink/testdata/config-multi-chain.toml @@ -109,4 +109,4 @@ ConfirmationPoll = '1h0m0s' [[Starknet.Nodes]] Name = 'primary' URL = 'http://stark.node' -APIKey = 'key' \ No newline at end of file +APIKey = 'key' diff --git a/core/services/chainlink/testdata/mergingsecretsdata/secrets-database.toml b/core/services/chainlink/testdata/mergingsecretsdata/secrets-database.toml index a2f60928a5e..db9d683a593 100644 --- a/core/services/chainlink/testdata/mergingsecretsdata/secrets-database.toml +++ b/core/services/chainlink/testdata/mergingsecretsdata/secrets-database.toml @@ -1,4 +1,4 @@ [Database] URL = "postgres://172.17.0.1:5432/primary" BackupURL = "postgres://172.17.0.1:5433/replica" -AllowSimplePasswords = false \ No newline at end of file +AllowSimplePasswords = false diff --git a/core/services/chainlink/testdata/secrets-empty-effective.toml b/core/services/chainlink/testdata/secrets-empty-effective.toml index 4ce337363c7..bcb5e53b474 100644 --- a/core/services/chainlink/testdata/secrets-empty-effective.toml +++ b/core/services/chainlink/testdata/secrets-empty-effective.toml @@ -1,2 +1,2 @@ [Database] -AllowSimplePasswords = false \ No newline at end of file +AllowSimplePasswords = false diff --git a/core/services/chainlink/testdata/secrets-full-redacted.toml b/core/services/chainlink/testdata/secrets-full-redacted.toml index ff6cd2a3123..9d91d79cb51 100644 --- a/core/services/chainlink/testdata/secrets-full-redacted.toml +++ b/core/services/chainlink/testdata/secrets-full-redacted.toml @@ -35,4 +35,4 @@ Password = 'xxxxx' LegacyURL = 'xxxxx' URL = 'xxxxx' Username = 'xxxxx' -Password = 'xxxxx' \ No newline at end of file +Password = 'xxxxx' diff --git a/core/services/chainlink/testdata/secrets-multi-redacted.toml b/core/services/chainlink/testdata/secrets-multi-redacted.toml index b77e0a705d6..27a1eb9fb6c 100644 --- a/core/services/chainlink/testdata/secrets-multi-redacted.toml +++ b/core/services/chainlink/testdata/secrets-multi-redacted.toml @@ -3,4 +3,4 @@ URL = 'xxxxx' AllowSimplePasswords = false [Password] -Keystore = 'xxxxx' \ No newline at end of file +Keystore = 'xxxxx' diff --git a/core/web/resolver/testdata/config-empty-effective.toml b/core/web/resolver/testdata/config-empty-effective.toml index d6a1ea4114d..f1b3ef56514 100644 --- a/core/web/resolver/testdata/config-empty-effective.toml +++ b/core/web/resolver/testdata/config-empty-effective.toml @@ -243,4 +243,4 @@ AnnounceAddresses = [] DefaultBootstrappers = [] DeltaDial = '15s' DeltaReconcile = '1m0s' -ListenAddresses = [] \ No newline at end of file +ListenAddresses = [] diff --git a/core/web/resolver/testdata/config-multi-chain-effective.toml b/core/web/resolver/testdata/config-multi-chain-effective.toml index 85be4c4799f..fc4dce01ef2 100644 --- a/core/web/resolver/testdata/config-multi-chain-effective.toml +++ b/core/web/resolver/testdata/config-multi-chain-effective.toml @@ -586,7 +586,7 @@ URL = 'http://testnet.solana.com' [[Starknet]] ChainID = 'foobar' -FeederURL = 'http:/feeder.url' +FeederURL = 'http://feeder.url' OCR2CachePollPeriod = '5s' OCR2CacheTTL = '1m0s' RequestTimeout = '10s'