Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestEngine: Template testing optimization #956

Merged
merged 32 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0e31b51
Ensure compilation
shargon Feb 26, 2024
d2b89e5
Merge branch 'master' into core-avoid-msbuild-compile
shargon Feb 26, 2024
637aa44
Update src/Neo.SmartContract.Testing/Coverage/Formats/ConsoleFormat.cs
shargon Feb 26, 2024
8ebaea8
TODO
shargon Feb 26, 2024
a2142bd
Move namespace
shargon Feb 26, 2024
10f54a9
LF
shargon Feb 26, 2024
505b7e2
LF
shargon Feb 26, 2024
1334f9f
LF
shargon Feb 26, 2024
05c9d4e
Merge branch 'master' into core-avoid-msbuild-compile
shargon Feb 26, 2024
619eaa9
Fix remove
shargon Feb 26, 2024
8560cac
indent comment
shargon Feb 26, 2024
c5f584c
Change artifact name
shargon Feb 26, 2024
f9546aa
Split options
shargon Feb 26, 2024
6c6f0eb
Fix Context result
shargon Feb 26, 2024
5eb6656
Clean debugInfo from artifacts
shargon Feb 26, 2024
a37fb3d
Merge branch 'master' into core-avoid-msbuild-compile
Jim8y Feb 26, 2024
d39813b
Fix compilation
shargon Feb 26, 2024
1a11b86
Merge branch 'core-avoid-msbuild-compile' of https://github.com/neo-p…
shargon Feb 26, 2024
ba7b375
Cleanup
shargon Feb 26, 2024
2f510bc
format
shargon Feb 26, 2024
9dd861a
remove artifacts
shargon Feb 26, 2024
e6c87ee
fix nep17 template
shargon Feb 26, 2024
5db5882
Fix type
shargon Feb 26, 2024
bf564dd
Rename artifacts
shargon Feb 26, 2024
02fc864
some fixes
shargon Feb 26, 2024
50a4f1d
Merge remote-tracking branch 'origin/master' into core-avoid-msbuild-…
shargon Feb 26, 2024
63b881d
Update .github/workflows/main.yml
shargon Feb 26, 2024
5b923eb
Clean
shargon Feb 26, 2024
116746e
Allow old code
shargon Feb 26, 2024
3204169
Fix old ECPoint
shargon Feb 26, 2024
6e8e257
Jimmy's feedback
shargon Feb 26, 2024
95a4ca0
Fix
shargon Feb 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Neo.Compiler.CSharp/CompilationEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public List<CompilationContext> Compile(IEnumerable<string> sourceFiles, IEnumer
return CompileProjectContracts(Compilation);
}

public List<CompilationContext> CompileSources(string[] sourceFiles)
public List<CompilationContext> CompileSources(params string[] sourceFiles)
{
List<MetadataReference> references = new(CommonReferences)
{
Expand Down
160 changes: 80 additions & 80 deletions src/Neo.SmartContract.Framework/ContractParameterType.cs
Original file line number Diff line number Diff line change
@@ -1,80 +1,80 @@
// Copyright (C) 2015-2023 The Neo Project.
//
// The Neo.SmartContract.Framework is free software distributed under the MIT
// software license, see the accompanying file LICENSE in the main directory
// of the project or http://www.opensource.org/licenses/mit-license.php
// for more details.
//
// Redistribution and use in source and binary forms with or without
// modifications are permitted.

namespace Neo.SmartContract
{
public enum ContractParameterType : byte
{
/// <summary>
/// Indicates that the parameter can be of any type.
/// </summary>
Any = 0x00,

/// <summary>
/// Indicates that the parameter is of Boolean type.
/// </summary>
Boolean = 0x10,

/// <summary>
/// Indicates that the parameter is an integer.
/// </summary>
Integer = 0x11,

/// <summary>
/// Indicates that the parameter is a byte array.
/// </summary>
ByteArray = 0x12,

/// <summary>
/// Indicates that the parameter is a string.
/// </summary>
String = 0x13,

/// <summary>
/// Indicates that the parameter is a 160-bit hash.
/// </summary>
Hash160 = 0x14,

/// <summary>
/// Indicates that the parameter is a 256-bit hash.
/// </summary>
Hash256 = 0x15,

/// <summary>
/// Indicates that the parameter is a public key.
/// </summary>
PublicKey = 0x16,

/// <summary>
/// Indicates that the parameter is a signature.
/// </summary>
Signature = 0x17,

/// <summary>
/// Indicates that the parameter is an array.
/// </summary>
Array = 0x20,

/// <summary>
/// Indicates that the parameter is a map.
/// </summary>
Map = 0x22,

/// <summary>
/// Indicates that the parameter is an interoperable interface.
/// </summary>
InteropInterface = 0x30,

/// <summary>
/// It can be only used as the return type of a method, meaning that the method has no return value.
/// </summary>
Void = 0xff
}
}
// Copyright (C) 2015-2023 The Neo Project.
//
// The Neo.SmartContract.Framework is free software distributed under the MIT
// software license, see the accompanying file LICENSE in the main directory
// of the project or http://www.opensource.org/licenses/mit-license.php
// for more details.
//
// Redistribution and use in source and binary forms with or without
// modifications are permitted.
namespace Neo.SmartContract.Framework
{
public enum ContractParameterType : byte
{
/// <summary>
/// Indicates that the parameter can be of any type.
/// </summary>
Any = 0x00,
/// <summary>
/// Indicates that the parameter is of Boolean type.
/// </summary>
Boolean = 0x10,
/// <summary>
/// Indicates that the parameter is an integer.
/// </summary>
Integer = 0x11,
/// <summary>
/// Indicates that the parameter is a byte array.
/// </summary>
ByteArray = 0x12,
/// <summary>
/// Indicates that the parameter is a string.
/// </summary>
String = 0x13,
/// <summary>
/// Indicates that the parameter is a 160-bit hash.
/// </summary>
Hash160 = 0x14,
/// <summary>
/// Indicates that the parameter is a 256-bit hash.
/// </summary>
Hash256 = 0x15,
/// <summary>
/// Indicates that the parameter is a public key.
/// </summary>
PublicKey = 0x16,
/// <summary>
/// Indicates that the parameter is a signature.
/// </summary>
Signature = 0x17,
/// <summary>
/// Indicates that the parameter is an array.
/// </summary>
Array = 0x20,
/// <summary>
/// Indicates that the parameter is a map.
/// </summary>
Map = 0x22,
/// <summary>
/// Indicates that the parameter is an interoperable interface.
/// </summary>
InteropInterface = 0x30,
/// <summary>
/// It can be only used as the return type of a method, meaning that the method has no return value.
/// </summary>
Void = 0xff
}
}
87 changes: 43 additions & 44 deletions src/Neo.SmartContract.Framework/ECPoint.cs
Original file line number Diff line number Diff line change
@@ -1,44 +1,43 @@
// Copyright (C) 2015-2023 The Neo Project.
//
// The Neo.SmartContract.Framework is free software distributed under the MIT
// software license, see the accompanying file LICENSE in the main directory
// of the project or http://www.opensource.org/licenses/mit-license.php
// for more details.
//
// Redistribution and use in source and binary forms with or without
// modifications are permitted.

using Neo.SmartContract.Framework;
using Neo.SmartContract.Framework.Attributes;

namespace Neo.Cryptography.ECC
{
public abstract class ECPoint : ByteString
{
public extern bool IsValid
{
[OpCode(OpCode.DUP)]
[OpCode(OpCode.ISTYPE, "0x28")] //ByteString
[OpCode(OpCode.SWAP)]
[OpCode(OpCode.SIZE)]
[OpCode(OpCode.PUSHINT8, "21")] // 0x21 == 33 bytes expected array size
[OpCode(OpCode.NUMEQUAL)]
[OpCode(OpCode.BOOLAND)]
get;
}

[OpCode(OpCode.CONVERT, StackItemType.ByteString)]
[OpCode(OpCode.DUP)]
[OpCode(OpCode.ISNULL)]
[OpCode(OpCode.JMPIF, "09")]
[OpCode(OpCode.DUP)]
[OpCode(OpCode.SIZE)]
[OpCode(OpCode.PUSHINT8, "21")] // 0x21 == 33 bytes expected array size
[OpCode(OpCode.JMPEQ, "03")]
[OpCode(OpCode.THROW)]
public static extern explicit operator ECPoint(byte[] value);

[OpCode(OpCode.CONVERT, StackItemType.Buffer)]
public static extern explicit operator byte[](ECPoint value);
}
}
// Copyright (C) 2015-2023 The Neo Project.
//
// The Neo.SmartContract.Framework is free software distributed under the MIT
// software license, see the accompanying file LICENSE in the main directory
// of the project or http://www.opensource.org/licenses/mit-license.php
// for more details.
//
// Redistribution and use in source and binary forms with or without
// modifications are permitted.

using Neo.SmartContract.Framework.Attributes;

namespace Neo.SmartContract.Framework
{
public abstract class ECPoint : ByteString
{
public extern bool IsValid
{
[OpCode(OpCode.DUP)]
[OpCode(OpCode.ISTYPE, "0x28")] //ByteString
[OpCode(OpCode.SWAP)]
[OpCode(OpCode.SIZE)]
[OpCode(OpCode.PUSHINT8, "21")] // 0x21 == 33 bytes expected array size
[OpCode(OpCode.NUMEQUAL)]
[OpCode(OpCode.BOOLAND)]
get;
}

[OpCode(OpCode.CONVERT, StackItemType.ByteString)]
[OpCode(OpCode.DUP)]
[OpCode(OpCode.ISNULL)]
[OpCode(OpCode.JMPIF, "09")]
[OpCode(OpCode.DUP)]
[OpCode(OpCode.SIZE)]
[OpCode(OpCode.PUSHINT8, "21")] // 0x21 == 33 bytes expected array size
[OpCode(OpCode.JMPEQ, "03")]
[OpCode(OpCode.THROW)]
public static extern explicit operator ECPoint(byte[] value);

[OpCode(OpCode.CONVERT, StackItemType.Buffer)]
public static extern explicit operator byte[](ECPoint value);
}
}
36 changes: 17 additions & 19 deletions src/Neo.SmartContract.Framework/Native/CalledByGroupCondition.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
// Copyright (C) 2015-2023 The Neo Project.
//
// The Neo.SmartContract.Framework is free software distributed under the MIT
// software license, see the accompanying file LICENSE in the main directory
// of the project or http://www.opensource.org/licenses/mit-license.php
// for more details.
//
// Redistribution and use in source and binary forms with or without
// modifications are permitted.

using Neo.Cryptography.ECC;

namespace Neo.SmartContract.Framework.Native
{
public class CalledByGroupCondition : WitnessCondition
{
public ECPoint Group;
}
}
// Copyright (C) 2015-2023 The Neo Project.
//
// The Neo.SmartContract.Framework is free software distributed under the MIT
// software license, see the accompanying file LICENSE in the main directory
// of the project or http://www.opensource.org/licenses/mit-license.php
// for more details.
//
// Redistribution and use in source and binary forms with or without
// modifications are permitted.

namespace Neo.SmartContract.Framework.Native
{
public class CalledByGroupCondition : WitnessCondition
{
public ECPoint Group;
}
}
62 changes: 31 additions & 31 deletions src/Neo.SmartContract.Framework/Native/CryptoLib.cs
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
// Copyright (C) 2015-2023 The Neo Project.
//
// The Neo.SmartContract.Framework is free software distributed under the MIT
// software license, see the accompanying file LICENSE in the main directory
// of the project or http://www.opensource.org/licenses/mit-license.php
// for more details.
//
// Redistribution and use in source and binary forms with or without
// modifications are permitted.

#pragma warning disable CS0626

using Neo.SmartContract.Framework.Attributes;

namespace Neo.SmartContract.Framework.Native
{
[Contract("0x726cb6e0cd8628a1350a611384688911ab75f51b")]
public static partial class CryptoLib
{
[ContractHash]
public static extern UInt160 Hash { get; }

public static extern ByteString Sha256(ByteString value);

public static extern ByteString Ripemd160(ByteString value);

public static extern ByteString Murmur32(ByteString value, uint seed);

public static extern bool VerifyWithECDsa(ByteString message, Cryptography.ECC.ECPoint pubkey, ByteString signature, NamedCurve curve);
}
}
// Copyright (C) 2015-2023 The Neo Project.
//
// The Neo.SmartContract.Framework is free software distributed under the MIT
// software license, see the accompanying file LICENSE in the main directory
// of the project or http://www.opensource.org/licenses/mit-license.php
// for more details.
//
// Redistribution and use in source and binary forms with or without
// modifications are permitted.
#pragma warning disable CS0626
using Neo.SmartContract.Framework.Attributes;
namespace Neo.SmartContract.Framework.Native
{
[Contract("0x726cb6e0cd8628a1350a611384688911ab75f51b")]
public static partial class CryptoLib
{
[ContractHash]
public static extern UInt160 Hash { get; }
public static extern ByteString Sha256(ByteString value);
public static extern ByteString Ripemd160(ByteString value);
public static extern ByteString Murmur32(ByteString value, uint seed);
public static extern bool VerifyWithECDsa(ByteString message, ECPoint pubkey, ByteString signature, NamedCurve curve);
}
}
36 changes: 17 additions & 19 deletions src/Neo.SmartContract.Framework/Native/GroupCondition.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
// Copyright (C) 2015-2023 The Neo Project.
//
// The Neo.SmartContract.Framework is free software distributed under the MIT
// software license, see the accompanying file LICENSE in the main directory
// of the project or http://www.opensource.org/licenses/mit-license.php
// for more details.
//
// Redistribution and use in source and binary forms with or without
// modifications are permitted.

using Neo.Cryptography.ECC;

namespace Neo.SmartContract.Framework.Native
{
public class GroupCondition : WitnessCondition
{
public ECPoint Group;
}
}
// Copyright (C) 2015-2023 The Neo Project.
//
// The Neo.SmartContract.Framework is free software distributed under the MIT
// software license, see the accompanying file LICENSE in the main directory
// of the project or http://www.opensource.org/licenses/mit-license.php
// for more details.
//
// Redistribution and use in source and binary forms with or without
// modifications are permitted.

namespace Neo.SmartContract.Framework.Native
{
public class GroupCondition : WitnessCondition
{
public ECPoint Group;
}
}
Loading
Loading