@@ -216,6 +216,54 @@ func TestResolveNodeMode(t *testing.T) {
216216 },
217217 wantMode : node .UltraLightMode ,
218218 },
219+ {
220+ name : "node-mode takes precedence over legacy full-node with warning" ,
221+ config : map [string ]any {
222+ optionNameNodeMode : "light" ,
223+ optionNameFullNode : true ,
224+ configKeyBlockchainRpcEndpoint : "http://localhost:8545" ,
225+ },
226+ wantMode : node .LightMode ,
227+ },
228+ {
229+ name : "ultra-light with rpc endpoint ignores rpc and succeeds" ,
230+ config : map [string ]any {
231+ optionNameNodeMode : "ultra-light" ,
232+ configKeyBlockchainRpcEndpoint : "http://localhost:8545" ,
233+ },
234+ wantMode : node .UltraLightMode ,
235+ },
236+ {
237+ name : "light mode with rpc, swap and chequebook succeeds" ,
238+ config : map [string ]any {
239+ optionNameNodeMode : "light" ,
240+ configKeyBlockchainRpcEndpoint : "http://localhost:8545" ,
241+ optionNameSwapEnable : true ,
242+ optionNameChequebookEnable : true ,
243+ },
244+ wantMode : node .LightMode ,
245+ },
246+ {
247+ name : "empty node-mode string fails validation" ,
248+ config : map [string ]any {
249+ optionNameNodeMode : "" ,
250+ },
251+ wantErr : "invalid node-mode" ,
252+ },
253+ {
254+ name : "uppercase node-mode string fails validation" ,
255+ config : map [string ]any {
256+ optionNameNodeMode : "FULL" ,
257+ },
258+ wantErr : "invalid node-mode" ,
259+ },
260+ {
261+ name : "whitespace node-mode string fails validation" ,
262+ config : map [string ]any {
263+ optionNameNodeMode : " full " ,
264+ },
265+ wantErr : "invalid node-mode" ,
266+ },
219267 }
220268
221269 for _ , tt := range tests {
0 commit comments