From c2dcc91f7d288c414a3467b786d975be33f2e8a6 Mon Sep 17 00:00:00 2001 From: isstuev Date: Wed, 14 Feb 2024 21:31:33 +0100 Subject: [PATCH] fix interpretation checks --- ui/tx/interpretation/utils.test.ts | 4 ++-- ui/tx/interpretation/utils.ts | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/tx/interpretation/utils.test.ts b/ui/tx/interpretation/utils.test.ts index be1c7d3380..f60532cb12 100644 --- a/ui/tx/interpretation/utils.test.ts +++ b/ui/tx/interpretation/utils.test.ts @@ -13,13 +13,13 @@ it('split string without capturing variables', () => { }); it('checks that summary is valid', () => { - const result = checkSummary('{foo} {bar}', { foo: { type: 'string', value: 'foo' }, bar: { type: 'string', value: 'bar' } }); + const result = checkSummary('{foo} {native} {bar}', { foo: { type: 'string', value: 'foo' }, bar: { type: 'string', value: 'bar' } }); expect(result).toBe(true); }); it('checks that summary is invalid', () => { // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore: - const result = checkSummary('{foo} {bar}', { foo: { type: 'string', value: null }, bar: { type: 'string', value: 'bar' } }); + const result = checkSummary('{foo} {native} {bar}', { foo: { type: 'string', value: null }, bar: { type: 'string', value: 'bar' } }); expect(result).toBe(false); }); diff --git a/ui/tx/interpretation/utils.ts b/ui/tx/interpretation/utils.ts index 8cccd15f27..bf480f3f8b 100644 --- a/ui/tx/interpretation/utils.ts +++ b/ui/tx/interpretation/utils.ts @@ -24,6 +24,9 @@ export function checkSummary(template: string, variables: Record