Skip to content

Commit d9aa157

Browse files
committed
fix issue
1 parent 5e5dbce commit d9aa157

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/Neo.SmartContract.Testing/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,4 +473,3 @@ The currently known limitations are:
473473

474474
- Receive events during the deploy, because the object is returned after performing the deploy, it is not possible to intercept notifications for the deploy unless the contract is previously created with `FromHash` knowing the hash of the contract to be created.
475475
- It is possible that if the contract is updated, the coverage calculation may be incorrect. The update method of a contract can be tested, but if the same script and abi as the original are not used, it can result in a coverage calculation error.
476-
- Some native contracts use the values of `CallingScriptHash` and `EntryScriptHash` for certain actions, such as `CheckWitness`, so overriding the syscalls with `OnGetEntryScriptHash` and `OnGetCallingScriptHash` could fail.

src/Neo.SmartContract.Testing/TestingApplicationEngine.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ public override UInt160 CallingScriptHash
3232
{
3333
get
3434
{
35-
var currentHash = InstructionContext.GetScriptHash();
36-
var hash = Engine.OnGetCallingScriptHash?.Invoke(currentHash);
35+
var hash = Engine.OnGetCallingScriptHash?.Invoke(CurrentScriptHash);
3736

3837
if (hash is not null)
3938
{
@@ -51,8 +50,7 @@ public override UInt160 EntryScriptHash
5150
{
5251
get
5352
{
54-
var currentHash = InstructionContext.GetScriptHash();
55-
var hash = Engine.OnGetEntryScriptHash?.Invoke(currentHash);
53+
var hash = Engine.OnGetEntryScriptHash?.Invoke(CurrentScriptHash);
5654

5755
if (hash is not null)
5856
{

0 commit comments

Comments
 (0)