Commit a4aa1e29 authored by isstuev's avatar isstuev

fix

parent 75b0bbed
...@@ -13,13 +13,13 @@ it('split string without capturing variables', () => { ...@@ -13,13 +13,13 @@ it('split string without capturing variables', () => {
}); });
it('checks that summary is valid', () => { 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); expect(result).toBe(true);
}); });
it('checks that summary is invalid', () => { it('checks that summary is invalid', () => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: // @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); expect(result).toBe(false);
}); });
...@@ -24,6 +24,9 @@ export function checkSummary(template: string, variables: Record<string, TxInter ...@@ -24,6 +24,9 @@ export function checkSummary(template: string, variables: Record<string, TxInter
const variablesNames = extractVariables(template); const variablesNames = extractVariables(template);
let result = true; let result = true;
for (const name of variablesNames) { for (const name of variablesNames) {
if (name === NATIVE_COIN_SYMBOL_VAR_NAME) {
continue;
}
if (!variables[name] || variables[name].value === undefined || variables[name].value === null) { if (!variables[name] || variables[name].value === undefined || variables[name].value === null) {
result = false; result = false;
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment