-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
652 additions
and
12 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
tests/Neo.Compiler.CSharp.TestContracts/Contract_BinaryExpression.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using Neo.SmartContract.Framework; | ||
using Neo.SmartContract.Framework.Services; | ||
using System.Numerics; | ||
|
||
namespace Neo.Compiler.CSharp.TestContracts | ||
{ | ||
public class Contract_BinaryExpression : SmartContract.Framework.SmartContract | ||
{ | ||
public static void BinaryIs() | ||
{ | ||
ByteString a = "a"; | ||
ExecutionEngine.Assert(a is ByteString); | ||
string b = $""; | ||
#pragma warning disable CS0184 | ||
ExecutionEngine.Assert(b is ByteString); | ||
#pragma warning restore CS0184 | ||
} | ||
|
||
public static void BinaryAs() | ||
{ | ||
UInt160 a = UInt160.Zero; | ||
ExecutionEngine.Assert(a as ByteString == UInt160.Zero); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_BinaryExpression.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using Neo.Cryptography.ECC; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Numerics; | ||
|
||
namespace Neo.SmartContract.Testing; | ||
|
||
public abstract class Contract_BinaryExpression(Neo.SmartContract.Testing.SmartContractInitialize initialize) : Neo.SmartContract.Testing.SmartContract(initialize), IContractInfo | ||
{ | ||
#region Compiled data | ||
|
||
public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_BinaryExpression"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""binaryIs"",""parameters"":[],""returntype"":""Void"",""offset"":0,""safe"":false},{""name"":""binaryAs"",""parameters"":[],""returntype"":""Void"",""offset"":19,""safe"":false}],""events"":[]},""permissions"":[],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); | ||
|
||
/// <summary> | ||
/// Optimization: "All" | ||
/// </summary> | ||
public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable<Neo.SmartContract.NefFile>(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE5XAgAMAWFwaNkoOQwAcWnZKDlAVwEADBQAAAAAAAAAAAAAAAAAAAAAAAAAAHBoStkoJARFCwwUAAAAAAAAAAAAAAAAAAAAAAAAAACXOUBlVuZG")); | ||
|
||
#endregion | ||
|
||
#region Unsafe methods | ||
|
||
/// <summary> | ||
/// Unsafe method | ||
/// </summary> | ||
/// <remarks> | ||
/// Script: VwEADBQAAAAAAAAAAAAAAAAAAAAAAAAAAHBoStkoJARFCwwUAAAAAAAAAAAAAAAAAAAAAAAAAACXOUA= | ||
/// INITSLOT 0100 [64 datoshi] | ||
/// PUSHDATA1 0000000000000000000000000000000000000000 [8 datoshi] | ||
/// STLOC0 [2 datoshi] | ||
/// LDLOC0 [2 datoshi] | ||
/// DUP [2 datoshi] | ||
/// ISTYPE 28 'ByteString' [2 datoshi] | ||
/// JMPIF 04 [2 datoshi] | ||
/// DROP [2 datoshi] | ||
/// PUSHNULL [1 datoshi] | ||
/// PUSHDATA1 0000000000000000000000000000000000000000 [8 datoshi] | ||
/// EQUAL [32 datoshi] | ||
/// ASSERT [1 datoshi] | ||
/// RET [0 datoshi] | ||
/// </remarks> | ||
[DisplayName("binaryAs")] | ||
public abstract void BinaryAs(); | ||
|
||
/// <summary> | ||
/// Unsafe method | ||
/// </summary> | ||
/// <remarks> | ||
/// Script: VwIADAFhcGjZKDkMAHFp2Sg5QA== | ||
/// INITSLOT 0200 [64 datoshi] | ||
/// PUSHDATA1 61 'a' [8 datoshi] | ||
/// STLOC0 [2 datoshi] | ||
/// LDLOC0 [2 datoshi] | ||
/// ISTYPE 28 'ByteString' [2 datoshi] | ||
/// ASSERT [1 datoshi] | ||
/// PUSHDATA1 [8 datoshi] | ||
/// STLOC1 [2 datoshi] | ||
/// LDLOC1 [2 datoshi] | ||
/// ISTYPE 28 'ByteString' [2 datoshi] | ||
/// ASSERT [1 datoshi] | ||
/// RET [0 datoshi] | ||
/// </remarks> | ||
[DisplayName("binaryIs")] | ||
public abstract void BinaryIs(); | ||
|
||
#endregion | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.