Skip to content

Commit

Permalink
have to add space at end of every TOML file
Browse files Browse the repository at this point in the history
  • Loading branch information
augustbleeds committed Mar 26, 2024
1 parent d5e1da2 commit 0495868
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 22 deletions.
2 changes: 1 addition & 1 deletion core/config/docs/chains-starknet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
APIKey = 'key' # Example
16 changes: 5 additions & 11 deletions core/services/chainlink/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1370,31 +1364,31 @@ 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)
}

inputLogs = observed.FilterMessageSnippet(input).All()
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)
}

inputLogs = observed.FilterMessageSnippet(effective).All()
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)
}

inputLogs = observed.FilterMessageSnippet(warning).All()
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)
}
})
Expand Down Expand Up @@ -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)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,4 @@ AnnounceAddresses = []
DefaultBootstrappers = []
DeltaDial = '15s'
DeltaReconcile = '1m0s'
ListenAddresses = []
ListenAddresses = []
2 changes: 1 addition & 1 deletion core/services/chainlink/testdata/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -441,4 +441,4 @@ ConfirmationPoll = '42s'
[[Starknet.Nodes]]
Name = 'primary'
URL = 'http://stark.node'
APIKey = 'key'
APIKey = 'key'
Original file line number Diff line number Diff line change
Expand Up @@ -596,4 +596,4 @@ ConfirmationPoll = '1h0m0s'
[[Starknet.Nodes]]
Name = 'primary'
URL = 'http://stark.node'
APIKey = 'key'
APIKey = 'key'
2 changes: 1 addition & 1 deletion core/services/chainlink/testdata/config-multi-chain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ ConfirmationPoll = '1h0m0s'
[[Starknet.Nodes]]
Name = 'primary'
URL = 'http://stark.node'
APIKey = 'key'
APIKey = 'key'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[Database]
URL = "postgres://172.17.0.1:5432/primary"
BackupURL = "postgres://172.17.0.1:5433/replica"
AllowSimplePasswords = false
AllowSimplePasswords = false
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[Database]
AllowSimplePasswords = false
AllowSimplePasswords = false
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ Password = 'xxxxx'
LegacyURL = 'xxxxx'
URL = 'xxxxx'
Username = 'xxxxx'
Password = 'xxxxx'
Password = 'xxxxx'
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ URL = 'xxxxx'
AllowSimplePasswords = false

[Password]
Keystore = 'xxxxx'
Keystore = 'xxxxx'
2 changes: 1 addition & 1 deletion core/web/resolver/testdata/config-empty-effective.toml
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,4 @@ AnnounceAddresses = []
DefaultBootstrappers = []
DeltaDial = '15s'
DeltaReconcile = '1m0s'
ListenAddresses = []
ListenAddresses = []
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 0495868

Please sign in to comment.