Skip to content

Commit e00cbe4

Browse files
shargonJim8y
andauthored
Apply suggestions from code review
Co-authored-by: Jimmy <[email protected]>
1 parent d9aa157 commit e00cbe4

File tree

1 file changed

+2
-28
lines changed

1 file changed

+2
-28
lines changed

src/Neo.SmartContract.Testing/TestingApplicationEngine.cs

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,38 +28,12 @@ internal class TestingApplicationEngine : ApplicationEngine
2828
/// <summary>
2929
/// Override CallingScriptHash
3030
/// </summary>
31-
public override UInt160 CallingScriptHash
32-
{
33-
get
34-
{
35-
var hash = Engine.OnGetCallingScriptHash?.Invoke(CurrentScriptHash);
36-
37-
if (hash is not null)
38-
{
39-
return hash;
40-
}
41-
42-
return base.CallingScriptHash;
43-
}
44-
}
31+
public override UInt160 CallingScriptHash => Engine.OnGetCallingScriptHash?.Invoke(CurrentScriptHash) ?? base.CallingScriptHash;
4532

4633
/// <summary>
4734
/// Override EntryScriptHash
4835
/// </summary>
49-
public override UInt160 EntryScriptHash
50-
{
51-
get
52-
{
53-
var hash = Engine.OnGetEntryScriptHash?.Invoke(CurrentScriptHash);
54-
55-
if (hash is not null)
56-
{
57-
return hash;
58-
}
59-
60-
return base.EntryScriptHash;
61-
}
62-
}
36+
public override UInt160 EntryScriptHash => Engine.OnGetEntryScriptHash?.Invoke(CurrentScriptHash) ?? base.EntryScriptHash;
6337

6438
public TestingApplicationEngine(TestEngine engine, TriggerType trigger, IVerifiable container, DataCache snapshot, Block persistingBlock)
6539
: base(trigger, container, snapshot, persistingBlock, engine.ProtocolSettings, engine.Gas, null)

0 commit comments

Comments
 (0)