Skip to content

Commit 072c6a2

Browse files
committed
Added BlockChain.Transactions
1 parent 0f90f7b commit 072c6a2

19 files changed

+475
-1
lines changed

.idea/.idea.BlockChain/.idea/contentModel.xml

+23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.BlockChain/.idea/workspace.xml

+15-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<Folder Include="Scripting\InterPreter" />
9+
<Folder Include="Scripting\Operations" />
10+
<Folder Include="Scripting\Scripts" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<ProjectReference Include="..\BlockChain.Core\BlockChain.Core.csproj" />
15+
</ItemGroup>
16+
17+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
namespace BlockChain.Transactions.Scripting.Enums
2+
{
3+
/// <summary>
4+
/// Enum with all the possible results of a script
5+
/// </summary>
6+
public enum EXECUTION_RESULT
7+
{
8+
SUCCESS,
9+
VERIFIED,
10+
FAILURE,
11+
12+
UNKNOWN_ERROR,
13+
INVALID_STACK,
14+
OP_NOT_IN_USE,
15+
MORE_ITEMS_ON_BOTTOM,
16+
NO_TRANSACTION_GIVEN,
17+
MATH_ERROR,
18+
DISABLED_CODE,
19+
EXECUTION_STOPPPED,
20+
LOCKTIME_ERROR,
21+
INVALID_BYTE_SIZE
22+
}
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
namespace BlockChain.Transactions.Scripting.Enums
2+
{
3+
/// <summary>
4+
/// Enum with all the OPCODES of a script (operators)
5+
/// </summary>
6+
public enum OPCODE
7+
{
8+
FALSE, TRUE,
9+
OP_1, OP_2, OP_3, OP_4, OP_5, OP_6, OP_7, OP_8, OP_9, OP_10, OP_11, OP_12, OP_13, OP_14, OP_15, OP_16,
10+
PUSHDATA_1, PUSHDATA_2, PUSHDATA_4,
11+
PUSH_INT, PUSH_UINT, PUSH_SHORT,
12+
13+
ADD, SUBSTRACT, MULTIPLY, DIVIDE, MODULO, ABS, NEGATE,
14+
LESSTHAN, GREATERTHAN, LESSOREQUAL, GREATEROREQUAL, MIN, MAX,
15+
EQ_NUM, EQ_VERIFY_NUM, OP_AND, OP_OR, OP_NOT,
16+
17+
EVAL_SCRIPT,
18+
19+
SHA256, HASH256, HASH160, RIPEMD160,
20+
SEPERATOR,
21+
22+
CHECKLOCKTIME,
23+
CHECKLOCKTIME_VERIFY,
24+
CHECKSIG,
25+
CHECKSIG_VERIFY,
26+
EQUALS,
27+
EQ_VERIFY,
28+
VERIFY,
29+
30+
DUP,
31+
DUP2,
32+
PUBKEY,
33+
PUBKEY_HASH,
34+
SIGNATURE,
35+
36+
DO_NOTHING,
37+
RETURN
38+
}
39+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace BlockChain.Transactions.Scripting.Enums
2+
{
3+
/// <summary>
4+
/// Enum with all script types
5+
/// </summary>
6+
public enum SCRIPTTYPE
7+
{
8+
LOCK_P2PK,
9+
LOCK_P2PKH,
10+
LOCK_P2SH,
11+
UNLOCK_P2PK,
12+
UNLOCK_P2PKH,
13+
UNLOCK_P2SH,
14+
UNKNOWN
15+
}
16+
}
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
3+
namespace BlockChain.Transactions
4+
{
5+
public class Transaction
6+
{
7+
public Transaction(byte[] data)
8+
{
9+
throw new NotImplementedException();
10+
}
11+
12+
public byte[] ToArray()
13+
{
14+
throw new NotImplementedException();
15+
}
16+
}
17+
}
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System.Collections.Generic;
2+
using BlockChain.Core.Block;
3+
4+
namespace BlockChain.Transactions
5+
{
6+
public class TransactionList : List<Transaction>, IBlockData
7+
{
8+
public TransactionList(byte[] data) => FromArray(data);
9+
10+
public new byte[] ToArray()
11+
{
12+
throw new System.NotImplementedException();
13+
}
14+
15+
public void FromArray(byte[] data)
16+
{
17+
throw new System.NotImplementedException();
18+
}
19+
20+
public bool IsValid() => true;
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"version": 1,
3+
"dgSpecHash": "v5YzzYO9GHU1UZj78OeOZzkKOYYXtODk1WwKY9mzN6uT8d6DKOh2RepvtXg9K5tAvSAYsv9iQsW2UKztY63THw==",
4+
"success": true
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
{
2+
"format": 1,
3+
"restore": {
4+
"/home/job/Documents/Projects/BlockChain/BlockChain.Transactions/BlockChain.Transactions.csproj": {}
5+
},
6+
"projects": {
7+
"/home/job/Documents/Projects/BlockChain/BlockChain.Core/BlockChain.Core.csproj": {
8+
"version": "1.0.0",
9+
"restore": {
10+
"projectUniqueName": "/home/job/Documents/Projects/BlockChain/BlockChain.Core/BlockChain.Core.csproj",
11+
"projectName": "BlockChain.Core",
12+
"projectPath": "/home/job/Documents/Projects/BlockChain/BlockChain.Core/BlockChain.Core.csproj",
13+
"packagesPath": "/home/job/.nuget/packages/",
14+
"outputPath": "/home/job/Documents/Projects/BlockChain/BlockChain.Core/obj/",
15+
"projectStyle": "PackageReference",
16+
"configFilePaths": [
17+
"/home/job/.config/NuGet/NuGet.Config"
18+
],
19+
"originalTargetFrameworks": [
20+
"netcoreapp3.1"
21+
],
22+
"sources": {
23+
"https://api.nuget.org/v3/index.json": {}
24+
},
25+
"frameworks": {
26+
"netcoreapp3.1": {
27+
"projectReferences": {}
28+
}
29+
},
30+
"warningProperties": {
31+
"warnAsError": [
32+
"NU1605"
33+
]
34+
}
35+
},
36+
"frameworks": {
37+
"netcoreapp3.1": {
38+
"imports": [
39+
"net461",
40+
"net462",
41+
"net47",
42+
"net471",
43+
"net472",
44+
"net48"
45+
],
46+
"assetTargetFallback": true,
47+
"warn": true,
48+
"frameworkReferences": {
49+
"Microsoft.NETCore.App": {
50+
"privateAssets": "all"
51+
}
52+
},
53+
"runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/3.1.100/RuntimeIdentifierGraph.json"
54+
}
55+
}
56+
},
57+
"/home/job/Documents/Projects/BlockChain/BlockChain.Transactions/BlockChain.Transactions.csproj": {
58+
"version": "1.0.0",
59+
"restore": {
60+
"projectUniqueName": "/home/job/Documents/Projects/BlockChain/BlockChain.Transactions/BlockChain.Transactions.csproj",
61+
"projectName": "BlockChain.Transactions",
62+
"projectPath": "/home/job/Documents/Projects/BlockChain/BlockChain.Transactions/BlockChain.Transactions.csproj",
63+
"packagesPath": "/home/job/.nuget/packages/",
64+
"outputPath": "/home/job/Documents/Projects/BlockChain/BlockChain.Transactions/obj/",
65+
"projectStyle": "PackageReference",
66+
"configFilePaths": [
67+
"/home/job/.config/NuGet/NuGet.Config"
68+
],
69+
"originalTargetFrameworks": [
70+
"netcoreapp3.1"
71+
],
72+
"sources": {
73+
"https://api.nuget.org/v3/index.json": {}
74+
},
75+
"frameworks": {
76+
"netcoreapp3.1": {
77+
"projectReferences": {
78+
"/home/job/Documents/Projects/BlockChain/BlockChain.Core/BlockChain.Core.csproj": {
79+
"projectPath": "/home/job/Documents/Projects/BlockChain/BlockChain.Core/BlockChain.Core.csproj"
80+
}
81+
}
82+
}
83+
},
84+
"warningProperties": {
85+
"warnAsError": [
86+
"NU1605"
87+
]
88+
}
89+
},
90+
"frameworks": {
91+
"netcoreapp3.1": {
92+
"imports": [
93+
"net461",
94+
"net462",
95+
"net47",
96+
"net471",
97+
"net472",
98+
"net48"
99+
],
100+
"assetTargetFallback": true,
101+
"warn": true,
102+
"frameworkReferences": {
103+
"Microsoft.NETCore.App": {
104+
"privateAssets": "all"
105+
}
106+
},
107+
"runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/3.1.100/RuntimeIdentifierGraph.json"
108+
}
109+
}
110+
}
111+
}
112+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8" standalone="no"?>
2+
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
4+
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
5+
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
6+
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
7+
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/home/job/.nuget/packages/</NuGetPackageRoot>
8+
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/home/job/.nuget/packages/</NuGetPackageFolders>
9+
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
10+
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.3.0</NuGetToolVersion>
11+
</PropertyGroup>
12+
<PropertyGroup>
13+
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
14+
</PropertyGroup>
15+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" standalone="no"?>
2+
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
5+
</PropertyGroup>
6+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by a tool.
4+
//
5+
// Changes to this file may cause incorrect behavior and will be lost if
6+
// the code is regenerated.
7+
// </auto-generated>
8+
//------------------------------------------------------------------------------
9+
10+
using System;
11+
using System.Reflection;
12+
13+
[assembly: System.Reflection.AssemblyCompanyAttribute("BlockChain.Transactions")]
14+
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
15+
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
16+
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
17+
[assembly: System.Reflection.AssemblyProductAttribute("BlockChain.Transactions")]
18+
[assembly: System.Reflection.AssemblyTitleAttribute("BlockChain.Transactions")]
19+
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
20+
21+
// Generated by the MSBuild WriteCodeFragment class.
22+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
99b9e3e1183863e2eaff4bfcc73d1ca2a1ceeffe
Binary file not shown.

0 commit comments

Comments
 (0)