From ec34dfe98805ba115520a4b4047b2947b392c0d8 Mon Sep 17 00:00:00 2001 From: Jan Segre Date: Wed, 10 Sep 2025 21:36:18 +0200 Subject: [PATCH] fix(nano): temporary alias to keep compatibility with testnet-hotel --- hathor/nanocontracts/blueprint_env.py | 3 +++ tests/nanocontracts/test_syscalls_in_view.py | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hathor/nanocontracts/blueprint_env.py b/hathor/nanocontracts/blueprint_env.py index 7cf1b5691..9fbc61022 100644 --- a/hathor/nanocontracts/blueprint_env.py +++ b/hathor/nanocontracts/blueprint_env.py @@ -259,6 +259,9 @@ def create_deposit_token( melt_authority ) + # XXX: temporary alias + create_token = create_deposit_token + @final def create_fee_token( self, diff --git a/tests/nanocontracts/test_syscalls_in_view.py b/tests/nanocontracts/test_syscalls_in_view.py index 17e5f014c..f7abd7d8f 100644 --- a/tests/nanocontracts/test_syscalls_in_view.py +++ b/tests/nanocontracts/test_syscalls_in_view.py @@ -101,6 +101,10 @@ def emit_event(self) -> None: def create_deposit_token(self) -> None: self.syscall.create_deposit_token('', '', 0) + @view + def create_token(self) -> None: + self.syscall.create_token('', '', 0) + @view def create_fee_token(self) -> None: self.syscall.create_fee_token('', '', 0) @@ -172,5 +176,6 @@ def test_syscalls(self) -> None: if method_name in allowed_view_syscalls: self.runner.call_view_method(contract_id, method_name) else: - with pytest.raises(NCViewMethodError, match=f'@view method cannot call `syscall.{method_name}`'): + method_name_err = method_name if method_name != 'create_token' else 'create_deposit_token' + with pytest.raises(NCViewMethodError, match=f'@view method cannot call `syscall.{method_name_err}`'): self.runner.call_view_method(contract_id, method_name)