Quellcode durchsuchen

block and blockchain are ready

yauhenip vor 6 Jahren
Ursprung
Commit
56ceb6a9b0

+ 13
- 0
.idea/compiler.xml Datei anzeigen

@@ -0,0 +1,13 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="CompilerConfiguration">
4
+    <annotationProcessing>
5
+      <profile name="Maven default annotation processors profile" enabled="true">
6
+        <sourceOutputDir name="target/generated-sources/annotations" />
7
+        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
8
+        <outputRelativeToContentRoot value="true" />
9
+        <module name="blueCoin" />
10
+      </profile>
11
+    </annotationProcessing>
12
+  </component>
13
+</project>

+ 6
- 0
.idea/encodings.xml Datei anzeigen

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="Encoding">
4
+    <file url="file://$PROJECT_DIR$" charset="UTF-8" />
5
+  </component>
6
+</project>

+ 14
- 0
.idea/misc.xml Datei anzeigen

@@ -0,0 +1,14 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ExternalStorageConfigurationManager" enabled="true" />
4
+  <component name="MavenProjectsManager">
5
+    <option name="originalFiles">
6
+      <list>
7
+        <option value="$PROJECT_DIR$/pom.xml" />
8
+      </list>
9
+    </option>
10
+  </component>
11
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
12
+    <output url="file://$PROJECT_DIR$/out" />
13
+  </component>
14
+</project>

+ 124
- 0
.idea/uiDesigner.xml Datei anzeigen

@@ -0,0 +1,124 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="Palette2">
4
+    <group name="Swing">
5
+      <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
6
+        <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
7
+      </item>
8
+      <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
9
+        <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
10
+      </item>
11
+      <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
12
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
13
+      </item>
14
+      <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
15
+        <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
16
+      </item>
17
+      <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
18
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
19
+        <initial-values>
20
+          <property name="text" value="Button" />
21
+        </initial-values>
22
+      </item>
23
+      <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
24
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
25
+        <initial-values>
26
+          <property name="text" value="RadioButton" />
27
+        </initial-values>
28
+      </item>
29
+      <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
30
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
31
+        <initial-values>
32
+          <property name="text" value="CheckBox" />
33
+        </initial-values>
34
+      </item>
35
+      <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
36
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
37
+        <initial-values>
38
+          <property name="text" value="Label" />
39
+        </initial-values>
40
+      </item>
41
+      <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
42
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
43
+          <preferred-size width="150" height="-1" />
44
+        </default-constraints>
45
+      </item>
46
+      <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
47
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
48
+          <preferred-size width="150" height="-1" />
49
+        </default-constraints>
50
+      </item>
51
+      <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
52
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
53
+          <preferred-size width="150" height="-1" />
54
+        </default-constraints>
55
+      </item>
56
+      <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
57
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
58
+          <preferred-size width="150" height="50" />
59
+        </default-constraints>
60
+      </item>
61
+      <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
62
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
63
+          <preferred-size width="150" height="50" />
64
+        </default-constraints>
65
+      </item>
66
+      <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
67
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
68
+          <preferred-size width="150" height="50" />
69
+        </default-constraints>
70
+      </item>
71
+      <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
72
+        <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
73
+      </item>
74
+      <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
75
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
76
+          <preferred-size width="150" height="50" />
77
+        </default-constraints>
78
+      </item>
79
+      <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
80
+        <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
81
+          <preferred-size width="150" height="50" />
82
+        </default-constraints>
83
+      </item>
84
+      <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
85
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
86
+          <preferred-size width="150" height="50" />
87
+        </default-constraints>
88
+      </item>
89
+      <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
90
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
91
+          <preferred-size width="200" height="200" />
92
+        </default-constraints>
93
+      </item>
94
+      <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
95
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
96
+          <preferred-size width="200" height="200" />
97
+        </default-constraints>
98
+      </item>
99
+      <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
100
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
101
+      </item>
102
+      <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
103
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
104
+      </item>
105
+      <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
106
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
107
+      </item>
108
+      <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
109
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
110
+      </item>
111
+      <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
112
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
113
+          <preferred-size width="-1" height="20" />
114
+        </default-constraints>
115
+      </item>
116
+      <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
117
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
118
+      </item>
119
+      <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
120
+        <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
121
+      </item>
122
+    </group>
123
+  </component>
124
+</project>

+ 6
- 0
.idea/vcs.xml Datei anzeigen

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="VcsDirectoryMappings">
4
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+  </component>
6
+</project>

+ 703
- 0
.idea/workspace.xml Datei anzeigen

@@ -0,0 +1,703 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ChangeListManager">
4
+    <list default="true" id="f30b8007-194d-46df-895d-6576c24c3628" name="Default" comment="">
5
+      <change afterPath="$PROJECT_DIR$/.idea/compiler.xml" afterDir="false" />
6
+      <change afterPath="$PROJECT_DIR$/.idea/encodings.xml" afterDir="false" />
7
+      <change afterPath="$PROJECT_DIR$/.idea/uiDesigner.xml" afterDir="false" />
8
+      <change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
9
+      <change afterPath="$PROJECT_DIR$/src/main/java/io/zipcoder/blue_coin_application/BlueCoinApplication.java" afterDir="false" />
10
+      <change afterPath="$PROJECT_DIR$/src/main/java/io/zipcoder/blue_coin_application/model/Block.java" afterDir="false" />
11
+      <change afterPath="$PROJECT_DIR$/src/main/java/io/zipcoder/blue_coin_application/model/Blockchain.java" afterDir="false" />
12
+      <change afterPath="$PROJECT_DIR$/src/main/java/io/zipcoder/blue_coin_application/utility/Encryption.java" afterDir="false" />
13
+      <change afterPath="$PROJECT_DIR$/src/test/java/io/zipcoder/blue_coin_application/TestBlock.java" afterDir="false" />
14
+      <change afterPath="$PROJECT_DIR$/src/test/java/io/zipcoder/blue_coin_application/TestBlockchain.java" afterDir="false" />
15
+    </list>
16
+    <ignored path="$PROJECT_DIR$/target/" />
17
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
18
+    <option name="TRACKING_ENABLED" value="true" />
19
+    <option name="SHOW_DIALOG" value="false" />
20
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
21
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
22
+    <option name="LAST_RESOLUTION" value="IGNORE" />
23
+  </component>
24
+  <component name="FileEditorManager">
25
+    <leaf>
26
+      <file leaf-file-name="pom.xml" pinned="false" current-in-tab="false">
27
+        <entry file="file://$PROJECT_DIR$/pom.xml">
28
+          <provider selected="true" editor-type-id="text-editor">
29
+            <state relative-caret-position="384">
30
+              <caret line="45" column="43" selection-start-line="45" selection-start-column="43" selection-end-line="45" selection-end-column="43" />
31
+            </state>
32
+          </provider>
33
+        </entry>
34
+      </file>
35
+      <file leaf-file-name="BlueCoinApplication.java" pinned="false" current-in-tab="false">
36
+        <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/blue_coin_application/BlueCoinApplication.java">
37
+          <provider selected="true" editor-type-id="text-editor">
38
+            <state relative-caret-position="30">
39
+              <caret line="2" column="34" selection-start-line="2" selection-start-column="34" selection-end-line="2" selection-end-column="34" />
40
+            </state>
41
+          </provider>
42
+        </entry>
43
+      </file>
44
+      <file leaf-file-name="Block.java" pinned="false" current-in-tab="false">
45
+        <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/blue_coin_application/model/Block.java">
46
+          <provider selected="true" editor-type-id="text-editor">
47
+            <state relative-caret-position="30">
48
+              <caret line="2" column="60" lean-forward="true" selection-start-line="2" selection-start-column="60" selection-end-line="2" selection-end-column="60" />
49
+              <folding>
50
+                <element signature="e#509#510#0" expanded="true" />
51
+                <element signature="e#536#537#0" expanded="true" />
52
+                <element signature="e#647#648#0" expanded="true" />
53
+                <element signature="e#682#683#0" expanded="true" />
54
+                <element signature="e#817#818#0" expanded="true" />
55
+                <element signature="e#844#845#0" expanded="true" />
56
+                <element signature="e#950#951#0" expanded="true" />
57
+                <element signature="e#982#983#0" expanded="true" />
58
+                <element signature="e#482#483#0" expanded="true" />
59
+                <element signature="e#514#515#0" expanded="true" />
60
+              </folding>
61
+            </state>
62
+          </provider>
63
+        </entry>
64
+      </file>
65
+      <file leaf-file-name="TestBlock.java" pinned="false" current-in-tab="false">
66
+        <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/blue_coin_application/TestBlock.java">
67
+          <provider selected="true" editor-type-id="text-editor">
68
+            <state relative-caret-position="285">
69
+              <caret line="19" column="46" selection-start-line="19" selection-start-column="46" selection-end-line="19" selection-end-column="46" />
70
+              <folding>
71
+                <element signature="imports" expanded="true" />
72
+              </folding>
73
+            </state>
74
+          </provider>
75
+        </entry>
76
+      </file>
77
+      <file leaf-file-name="Blockchain.java" pinned="false" current-in-tab="false">
78
+        <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/blue_coin_application/model/Blockchain.java">
79
+          <provider selected="true" editor-type-id="text-editor">
80
+            <state relative-caret-position="129">
81
+              <caret line="23" column="5" lean-forward="true" selection-start-line="23" selection-start-column="5" selection-end-line="23" selection-end-column="5" />
82
+              <folding>
83
+                <element signature="imports" expanded="true" />
84
+                <element signature="e#449#450#0" expanded="true" />
85
+                <element signature="e#482#483#0" expanded="true" />
86
+                <element signature="e#546#547#0" expanded="true" />
87
+                <element signature="e#596#597#0" expanded="true" />
88
+                <element signature="e#629#630#0" expanded="true" />
89
+                <element signature="e#655#656#0" expanded="true" />
90
+                <element signature="e#726#727#0" expanded="true" />
91
+                <element signature="e#766#767#0" expanded="true" />
92
+              </folding>
93
+            </state>
94
+          </provider>
95
+        </entry>
96
+      </file>
97
+      <file leaf-file-name="TestBlockchain.java" pinned="false" current-in-tab="true">
98
+        <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/blue_coin_application/TestBlockchain.java">
99
+          <provider selected="true" editor-type-id="text-editor">
100
+            <state relative-caret-position="390">
101
+              <caret line="26" column="8" selection-start-line="26" selection-start-column="8" selection-end-line="26" selection-end-column="8" />
102
+              <folding>
103
+                <element signature="imports" expanded="true" />
104
+              </folding>
105
+            </state>
106
+          </provider>
107
+        </entry>
108
+      </file>
109
+      <file leaf-file-name="Encryption.java" pinned="false" current-in-tab="false">
110
+        <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/blue_coin_application/utility/Encryption.java">
111
+          <provider selected="true" editor-type-id="text-editor">
112
+            <state relative-caret-position="90">
113
+              <caret line="6" column="25" selection-start-line="6" selection-start-column="25" selection-end-line="6" selection-end-column="25" />
114
+              <folding>
115
+                <element signature="imports" expanded="true" />
116
+              </folding>
117
+            </state>
118
+          </provider>
119
+        </entry>
120
+      </file>
121
+    </leaf>
122
+  </component>
123
+  <component name="FileTemplateManagerImpl">
124
+    <option name="RECENT_TEMPLATES">
125
+      <list>
126
+        <option value="FxmlFile" />
127
+        <option value="Class" />
128
+      </list>
129
+    </option>
130
+  </component>
131
+  <component name="Git.Settings">
132
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
133
+  </component>
134
+  <component name="IdeDocumentHistory">
135
+    <option name="CHANGED_PATHS">
136
+      <list>
137
+        <option value="$PROJECT_DIR$/src/main/java/io/zipcoder/blue_coin_application/utility/Encryption.java" />
138
+        <option value="$PROJECT_DIR$/src/main/java/io/zipcoder/blue_coin_application/model/Block.java" />
139
+        <option value="$PROJECT_DIR$/src/test/java/io/zipcoder/blue_coin_application/TestBlock.java" />
140
+        <option value="$PROJECT_DIR$/pom.xml" />
141
+        <option value="$PROJECT_DIR$/src/main/java/io/zipcoder/blue_coin_application/model/Blockchain.java" />
142
+        <option value="$PROJECT_DIR$/src/test/java/io/zipcoder/blue_coin_application/TestBlockchain.java" />
143
+      </list>
144
+    </option>
145
+  </component>
146
+  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
147
+  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
148
+  <component name="JsGulpfileManager">
149
+    <detection-done>true</detection-done>
150
+    <sorting>DEFINITION_ORDER</sorting>
151
+  </component>
152
+  <component name="MavenImportPreferences">
153
+    <option name="importingSettings">
154
+      <MavenImportingSettings>
155
+        <option name="importAutomatically" value="true" />
156
+      </MavenImportingSettings>
157
+    </option>
158
+  </component>
159
+  <component name="NodePackageJsonFileManager">
160
+    <packageJsonPaths />
161
+  </component>
162
+  <component name="ProjectFrameBounds">
163
+    <option name="x" value="-133" />
164
+    <option name="y" value="-957" />
165
+    <option name="width" value="1920" />
166
+    <option name="height" value="1057" />
167
+  </component>
168
+  <component name="ProjectLevelVcsManager" settingsEditedManually="true">
169
+    <ConfirmationsSetting value="2" id="Add" />
170
+  </component>
171
+  <component name="ProjectView">
172
+    <navigator proportions="" version="1">
173
+      <foldersAlwaysOnTop value="true" />
174
+    </navigator>
175
+    <panes>
176
+      <pane id="ProjectPane">
177
+        <subPane>
178
+          <expand>
179
+            <path>
180
+              <item name="blueCoin" type="b2602c69:ProjectViewProjectNode" />
181
+              <item name="blueCoin" type="462c0819:PsiDirectoryNode" />
182
+            </path>
183
+            <path>
184
+              <item name="blueCoin" type="b2602c69:ProjectViewProjectNode" />
185
+              <item name="blueCoin" type="462c0819:PsiDirectoryNode" />
186
+              <item name="src" type="462c0819:PsiDirectoryNode" />
187
+            </path>
188
+            <path>
189
+              <item name="blueCoin" type="b2602c69:ProjectViewProjectNode" />
190
+              <item name="blueCoin" type="462c0819:PsiDirectoryNode" />
191
+              <item name="src" type="462c0819:PsiDirectoryNode" />
192
+              <item name="main" type="462c0819:PsiDirectoryNode" />
193
+            </path>
194
+            <path>
195
+              <item name="blueCoin" type="b2602c69:ProjectViewProjectNode" />
196
+              <item name="blueCoin" type="462c0819:PsiDirectoryNode" />
197
+              <item name="src" type="462c0819:PsiDirectoryNode" />
198
+              <item name="main" type="462c0819:PsiDirectoryNode" />
199
+              <item name="java" type="462c0819:PsiDirectoryNode" />
200
+            </path>
201
+            <path>
202
+              <item name="blueCoin" type="b2602c69:ProjectViewProjectNode" />
203
+              <item name="blueCoin" type="462c0819:PsiDirectoryNode" />
204
+              <item name="src" type="462c0819:PsiDirectoryNode" />
205
+              <item name="main" type="462c0819:PsiDirectoryNode" />
206
+              <item name="java" type="462c0819:PsiDirectoryNode" />
207
+              <item name="blue_coin_application" type="462c0819:PsiDirectoryNode" />
208
+            </path>
209
+            <path>
210
+              <item name="blueCoin" type="b2602c69:ProjectViewProjectNode" />
211
+              <item name="blueCoin" type="462c0819:PsiDirectoryNode" />
212
+              <item name="src" type="462c0819:PsiDirectoryNode" />
213
+              <item name="main" type="462c0819:PsiDirectoryNode" />
214
+              <item name="java" type="462c0819:PsiDirectoryNode" />
215
+              <item name="blue_coin_application" type="462c0819:PsiDirectoryNode" />
216
+              <item name="model" type="462c0819:PsiDirectoryNode" />
217
+            </path>
218
+            <path>
219
+              <item name="blueCoin" type="b2602c69:ProjectViewProjectNode" />
220
+              <item name="blueCoin" type="462c0819:PsiDirectoryNode" />
221
+              <item name="src" type="462c0819:PsiDirectoryNode" />
222
+              <item name="main" type="462c0819:PsiDirectoryNode" />
223
+              <item name="java" type="462c0819:PsiDirectoryNode" />
224
+              <item name="blue_coin_application" type="462c0819:PsiDirectoryNode" />
225
+              <item name="utility" type="462c0819:PsiDirectoryNode" />
226
+            </path>
227
+            <path>
228
+              <item name="blueCoin" type="b2602c69:ProjectViewProjectNode" />
229
+              <item name="blueCoin" type="462c0819:PsiDirectoryNode" />
230
+              <item name="src" type="462c0819:PsiDirectoryNode" />
231
+              <item name="test" type="462c0819:PsiDirectoryNode" />
232
+            </path>
233
+            <path>
234
+              <item name="blueCoin" type="b2602c69:ProjectViewProjectNode" />
235
+              <item name="blueCoin" type="462c0819:PsiDirectoryNode" />
236
+              <item name="src" type="462c0819:PsiDirectoryNode" />
237
+              <item name="test" type="462c0819:PsiDirectoryNode" />
238
+              <item name="java" type="462c0819:PsiDirectoryNode" />
239
+            </path>
240
+            <path>
241
+              <item name="blueCoin" type="b2602c69:ProjectViewProjectNode" />
242
+              <item name="blueCoin" type="462c0819:PsiDirectoryNode" />
243
+              <item name="src" type="462c0819:PsiDirectoryNode" />
244
+              <item name="test" type="462c0819:PsiDirectoryNode" />
245
+              <item name="java" type="462c0819:PsiDirectoryNode" />
246
+              <item name="blue_coin_application" type="462c0819:PsiDirectoryNode" />
247
+            </path>
248
+          </expand>
249
+          <select />
250
+        </subPane>
251
+      </pane>
252
+      <pane id="AndroidView" />
253
+      <pane id="PackagesPane" />
254
+      <pane id="Scope" />
255
+    </panes>
256
+  </component>
257
+  <component name="PropertiesComponent">
258
+    <property name="WebServerToolWindowFactoryState" value="false" />
259
+    <property name="aspect.path.notification.shown" value="true" />
260
+    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
261
+    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
262
+    <property name="project.structure.last.edited" value="Modules" />
263
+    <property name="project.structure.proportion" value="0.0" />
264
+    <property name="project.structure.side.proportion" value="0.2" />
265
+  </component>
266
+  <component name="RunDashboard">
267
+    <option name="ruleStates">
268
+      <list>
269
+        <RuleState>
270
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
271
+        </RuleState>
272
+        <RuleState>
273
+          <option name="name" value="StatusDashboardGroupingRule" />
274
+        </RuleState>
275
+      </list>
276
+    </option>
277
+  </component>
278
+  <component name="RunManager" selected="JUnit.TestBlockchain.testIsChainValid">
279
+    <configuration default="true" type="Application" factoryName="Application">
280
+      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
281
+    </configuration>
282
+    <configuration name="TestBlock" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
283
+      <module name="blueCoin" />
284
+      <extension name="coverage">
285
+        <pattern>
286
+          <option name="PATTERN" value="io.zipcoder.blue_coin_application.*" />
287
+          <option name="ENABLED" value="true" />
288
+        </pattern>
289
+      </extension>
290
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
291
+      <option name="ALTERNATIVE_JRE_PATH" />
292
+      <option name="PACKAGE_NAME" value="io.zipcoder.blue_coin_application" />
293
+      <option name="MAIN_CLASS_NAME" value="io.zipcoder.blue_coin_application.TestBlock" />
294
+      <option name="METHOD_NAME" />
295
+      <option name="TEST_OBJECT" value="class" />
296
+      <option name="VM_PARAMETERS" value="-ea" />
297
+      <option name="PARAMETERS" />
298
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
299
+      <option name="PASS_PARENT_ENVS" value="true" />
300
+      <option name="TEST_SEARCH_SCOPE">
301
+        <value defaultName="singleModule" />
302
+      </option>
303
+      <patterns />
304
+    </configuration>
305
+    <configuration name="TestBlock.testCalculateHash" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
306
+      <module name="blueCoin" />
307
+      <extension name="coverage">
308
+        <pattern>
309
+          <option name="PATTERN" value="io.zipcoder.blue_coin_application.*" />
310
+          <option name="ENABLED" value="true" />
311
+        </pattern>
312
+      </extension>
313
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
314
+      <option name="ALTERNATIVE_JRE_PATH" />
315
+      <option name="PACKAGE_NAME" value="io.zipcoder.blue_coin_application" />
316
+      <option name="MAIN_CLASS_NAME" value="io.zipcoder.blue_coin_application.TestBlock" />
317
+      <option name="METHOD_NAME" value="testCalculateHash" />
318
+      <option name="TEST_OBJECT" value="method" />
319
+      <option name="VM_PARAMETERS" value="-ea" />
320
+      <option name="PARAMETERS" />
321
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
322
+      <option name="PASS_PARENT_ENVS" value="true" />
323
+      <option name="TEST_SEARCH_SCOPE">
324
+        <value defaultName="singleModule" />
325
+      </option>
326
+      <patterns />
327
+    </configuration>
328
+    <configuration name="TestBlockchain.testAddBlockToChain" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
329
+      <module name="blueCoin" />
330
+      <extension name="coverage">
331
+        <pattern>
332
+          <option name="PATTERN" value="io.zipcoder.blue_coin_application.*" />
333
+          <option name="ENABLED" value="true" />
334
+        </pattern>
335
+      </extension>
336
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
337
+      <option name="ALTERNATIVE_JRE_PATH" />
338
+      <option name="PACKAGE_NAME" value="io.zipcoder.blue_coin_application" />
339
+      <option name="MAIN_CLASS_NAME" value="io.zipcoder.blue_coin_application.TestBlockchain" />
340
+      <option name="METHOD_NAME" value="testAddBlockToChain" />
341
+      <option name="TEST_OBJECT" value="method" />
342
+      <option name="VM_PARAMETERS" value="-ea" />
343
+      <option name="PARAMETERS" />
344
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
345
+      <option name="PASS_PARENT_ENVS" value="true" />
346
+      <option name="TEST_SEARCH_SCOPE">
347
+        <value defaultName="singleModule" />
348
+      </option>
349
+      <patterns />
350
+    </configuration>
351
+    <configuration name="TestBlockchain.testIsChainValid" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
352
+      <module name="blueCoin" />
353
+      <extension name="coverage">
354
+        <pattern>
355
+          <option name="PATTERN" value="io.zipcoder.blue_coin_application.*" />
356
+          <option name="ENABLED" value="true" />
357
+        </pattern>
358
+      </extension>
359
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
360
+      <option name="ALTERNATIVE_JRE_PATH" />
361
+      <option name="PACKAGE_NAME" value="io.zipcoder.blue_coin_application" />
362
+      <option name="MAIN_CLASS_NAME" value="io.zipcoder.blue_coin_application.TestBlockchain" />
363
+      <option name="METHOD_NAME" value="testIsChainValid" />
364
+      <option name="TEST_OBJECT" value="method" />
365
+      <option name="VM_PARAMETERS" value="-ea" />
366
+      <option name="PARAMETERS" />
367
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
368
+      <option name="PASS_PARENT_ENVS" value="true" />
369
+      <option name="TEST_SEARCH_SCOPE">
370
+        <value defaultName="singleModule" />
371
+      </option>
372
+      <patterns />
373
+    </configuration>
374
+    <configuration default="true" type="JUnit" factoryName="JUnit">
375
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
376
+      <option name="ALTERNATIVE_JRE_PATH" />
377
+      <option name="PACKAGE_NAME" />
378
+      <option name="MAIN_CLASS_NAME" />
379
+      <option name="METHOD_NAME" />
380
+      <option name="TEST_OBJECT" value="class" />
381
+      <option name="VM_PARAMETERS" value="-ea" />
382
+      <option name="PARAMETERS" />
383
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
384
+      <option name="PASS_PARENT_ENVS" value="true" />
385
+      <option name="TEST_SEARCH_SCOPE">
386
+        <value defaultName="singleModule" />
387
+      </option>
388
+      <patterns />
389
+    </configuration>
390
+    <configuration name="utility in blueCoin" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
391
+      <module name="blueCoin" />
392
+      <extension name="coverage">
393
+        <pattern>
394
+          <option name="PATTERN" value="utility.*" />
395
+          <option name="ENABLED" value="true" />
396
+        </pattern>
397
+      </extension>
398
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
399
+      <option name="ALTERNATIVE_JRE_PATH" />
400
+      <option name="PACKAGE_NAME" value="utility" />
401
+      <option name="MAIN_CLASS_NAME" />
402
+      <option name="METHOD_NAME" />
403
+      <option name="TEST_OBJECT" value="package" />
404
+      <option name="VM_PARAMETERS" value="-ea" />
405
+      <option name="PARAMETERS" />
406
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
407
+      <option name="PASS_PARENT_ENVS" value="true" />
408
+      <option name="TEST_SEARCH_SCOPE">
409
+        <value defaultName="singleModule" />
410
+      </option>
411
+      <patterns />
412
+    </configuration>
413
+    <configuration default="true" type="TestNG" factoryName="TestNG">
414
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
415
+      <option name="ALTERNATIVE_JRE_PATH" />
416
+      <option name="SUITE_NAME" />
417
+      <option name="PACKAGE_NAME" />
418
+      <option name="MAIN_CLASS_NAME" />
419
+      <option name="METHOD_NAME" />
420
+      <option name="GROUP_NAME" />
421
+      <option name="TEST_OBJECT" value="CLASS" />
422
+      <option name="VM_PARAMETERS" value="-ea" />
423
+      <option name="PARAMETERS" />
424
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
425
+      <option name="OUTPUT_DIRECTORY" />
426
+      <option name="PASS_PARENT_ENVS" value="true" />
427
+      <option name="TEST_SEARCH_SCOPE">
428
+        <value defaultName="singleModule" />
429
+      </option>
430
+      <option name="USE_DEFAULT_REPORTERS" value="false" />
431
+      <option name="PROPERTIES_FILE" />
432
+      <properties />
433
+      <listeners />
434
+    </configuration>
435
+    <list>
436
+      <item itemvalue="JUnit.utility in blueCoin" />
437
+      <item itemvalue="JUnit.TestBlock.testCalculateHash" />
438
+      <item itemvalue="JUnit.TestBlock" />
439
+      <item itemvalue="JUnit.TestBlockchain.testAddBlockToChain" />
440
+      <item itemvalue="JUnit.TestBlockchain.testIsChainValid" />
441
+    </list>
442
+    <recent_temporary>
443
+      <list>
444
+        <item itemvalue="JUnit.TestBlockchain.testIsChainValid" />
445
+        <item itemvalue="JUnit.TestBlockchain.testAddBlockToChain" />
446
+        <item itemvalue="JUnit.TestBlock" />
447
+        <item itemvalue="JUnit.TestBlock.testCalculateHash" />
448
+        <item itemvalue="JUnit.utility in blueCoin" />
449
+      </list>
450
+    </recent_temporary>
451
+  </component>
452
+  <component name="SvnConfiguration">
453
+    <configuration />
454
+  </component>
455
+  <component name="TaskManager">
456
+    <task active="true" id="Default" summary="Default task">
457
+      <changelist id="f30b8007-194d-46df-895d-6576c24c3628" name="Default" comment="" />
458
+      <created>1531488814802</created>
459
+      <option name="number" value="Default" />
460
+      <option name="presentableId" value="Default" />
461
+      <updated>1531488814802</updated>
462
+      <workItem from="1531488821337" duration="5752000" />
463
+    </task>
464
+    <servers />
465
+  </component>
466
+  <component name="TestHistory">
467
+    <history-entry file="utility_in_blueCoin - 2018.07.13 at 09h 52m 04s.xml">
468
+      <configuration name="utility in blueCoin" configurationId="JUnit" />
469
+    </history-entry>
470
+    <history-entry file="TestBlock_testCalculateHash - 2018.07.13 at 10h 07m 00s.xml">
471
+      <configuration name="TestBlock.testCalculateHash" configurationId="JUnit" />
472
+    </history-entry>
473
+    <history-entry file="TestBlock - 2018.07.13 at 10h 11m 30s.xml">
474
+      <configuration name="TestBlock" configurationId="JUnit" />
475
+    </history-entry>
476
+    <history-entry file="TestBlockchain_testAddBlockToChain - 2018.07.13 at 10h 47m 16s.xml">
477
+      <configuration name="TestBlockchain.testAddBlockToChain" configurationId="JUnit" />
478
+    </history-entry>
479
+  </component>
480
+  <component name="TimeTrackingManager">
481
+    <option name="totallyTimeSpent" value="5752000" />
482
+  </component>
483
+  <component name="ToolWindowManager">
484
+    <frame x="-133" y="-957" width="1920" height="1057" extended-state="0" />
485
+    <editor active="true" />
486
+    <layout>
487
+      <window_info anchor="right" id="Palette" />
488
+      <window_info anchor="bottom" id="Event Log" side_tool="true" />
489
+      <window_info anchor="right" id="Maven Projects" />
490
+      <window_info anchor="bottom" id="Database Changes" show_stripe_button="false" />
491
+      <window_info id="Capture Tool" />
492
+      <window_info id="Designer" />
493
+      <window_info anchor="right" id="Database" />
494
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
495
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
496
+      <window_info id="UI Designer" />
497
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
498
+      <window_info anchor="bottom" id="TODO" order="6" />
499
+      <window_info anchor="bottom" id="Messages" />
500
+      <window_info anchor="right" id="Palette&#9;" />
501
+      <window_info id="Image Layers" />
502
+      <window_info anchor="bottom" id="Java Enterprise" />
503
+      <window_info anchor="right" id="Capture Analysis" />
504
+      <window_info anchor="bottom" id="Run" order="2" visible="true" weight="0.32916668" />
505
+      <window_info anchor="bottom" id="Version Control" />
506
+      <window_info anchor="bottom" id="Spring" />
507
+      <window_info anchor="bottom" id="Terminal" />
508
+      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.24973376" />
509
+      <window_info anchor="right" id="Bean Validation" />
510
+      <window_info id="Web" side_tool="true" />
511
+      <window_info anchor="right" id="Theme Preview" />
512
+      <window_info id="Favorites" side_tool="true" />
513
+      <window_info anchor="bottom" id="Find" order="1" />
514
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
515
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
516
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
517
+      <window_info anchor="bottom" id="Message" order="0" />
518
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
519
+    </layout>
520
+  </component>
521
+  <component name="TypeScriptGeneratedFilesManager">
522
+    <option name="version" value="1" />
523
+  </component>
524
+  <component name="VcsContentAnnotationSettings">
525
+    <option name="myLimit" value="2678400000" />
526
+  </component>
527
+  <component name="XDebuggerManager">
528
+    <breakpoint-manager>
529
+      <option name="time" value="2" />
530
+    </breakpoint-manager>
531
+  </component>
532
+  <component name="editorHistoryManager">
533
+    <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/blue_coin_application/utility/Encryption.java">
534
+      <provider selected="true" editor-type-id="text-editor">
535
+        <state relative-caret-position="90">
536
+          <caret line="6" column="25" selection-start-line="6" selection-start-column="25" selection-end-line="6" selection-end-column="25" />
537
+          <folding>
538
+            <element signature="imports" expanded="true" />
539
+          </folding>
540
+        </state>
541
+      </provider>
542
+    </entry>
543
+    <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/blue_coin_application/BlueCoinApplication.java">
544
+      <provider selected="true" editor-type-id="text-editor">
545
+        <state relative-caret-position="30">
546
+          <caret line="2" column="34" selection-start-line="2" selection-start-column="34" selection-end-line="2" selection-end-column="34" />
547
+        </state>
548
+      </provider>
549
+    </entry>
550
+    <entry file="file://$PROJECT_DIR$/pom.xml">
551
+      <provider selected="true" editor-type-id="text-editor">
552
+        <state relative-caret-position="384">
553
+          <caret line="45" column="43" selection-start-line="45" selection-start-column="43" selection-end-line="45" selection-end-column="43" />
554
+        </state>
555
+      </provider>
556
+    </entry>
557
+    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/blue_coin_application/TestBlock.java">
558
+      <provider selected="true" editor-type-id="text-editor">
559
+        <state relative-caret-position="285">
560
+          <caret line="19" column="46" selection-start-line="19" selection-start-column="46" selection-end-line="19" selection-end-column="46" />
561
+          <folding>
562
+            <element signature="imports" expanded="true" />
563
+          </folding>
564
+        </state>
565
+      </provider>
566
+    </entry>
567
+    <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/blue_coin_application/model/Block.java">
568
+      <provider selected="true" editor-type-id="text-editor">
569
+        <state relative-caret-position="30">
570
+          <caret line="2" column="60" lean-forward="true" selection-start-line="2" selection-start-column="60" selection-end-line="2" selection-end-column="60" />
571
+          <folding>
572
+            <element signature="e#509#510#0" expanded="true" />
573
+            <element signature="e#536#537#0" expanded="true" />
574
+            <element signature="e#647#648#0" expanded="true" />
575
+            <element signature="e#682#683#0" expanded="true" />
576
+            <element signature="e#817#818#0" expanded="true" />
577
+            <element signature="e#844#845#0" expanded="true" />
578
+            <element signature="e#950#951#0" expanded="true" />
579
+            <element signature="e#982#983#0" expanded="true" />
580
+            <element signature="e#482#483#0" expanded="true" />
581
+            <element signature="e#514#515#0" expanded="true" />
582
+          </folding>
583
+        </state>
584
+      </provider>
585
+    </entry>
586
+    <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/blue_coin_application/model/Blockchain.java">
587
+      <provider selected="true" editor-type-id="text-editor">
588
+        <state relative-caret-position="129">
589
+          <caret line="23" column="5" lean-forward="true" selection-start-line="23" selection-start-column="5" selection-end-line="23" selection-end-column="5" />
590
+          <folding>
591
+            <element signature="imports" expanded="true" />
592
+            <element signature="e#449#450#0" expanded="true" />
593
+            <element signature="e#482#483#0" expanded="true" />
594
+            <element signature="e#546#547#0" expanded="true" />
595
+            <element signature="e#596#597#0" expanded="true" />
596
+            <element signature="e#629#630#0" expanded="true" />
597
+            <element signature="e#655#656#0" expanded="true" />
598
+            <element signature="e#726#727#0" expanded="true" />
599
+            <element signature="e#766#767#0" expanded="true" />
600
+          </folding>
601
+        </state>
602
+      </provider>
603
+    </entry>
604
+    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/blue_coin_application/TestBlockchain.java">
605
+      <provider selected="true" editor-type-id="text-editor">
606
+        <state relative-caret-position="390">
607
+          <caret line="26" column="8" selection-start-line="26" selection-start-column="8" selection-end-line="26" selection-end-column="8" />
608
+          <folding>
609
+            <element signature="imports" expanded="true" />
610
+          </folding>
611
+        </state>
612
+      </provider>
613
+    </entry>
614
+  </component>
615
+  <component name="masterDetails">
616
+    <states>
617
+      <state key="ArtifactsStructureConfigurable.UI">
618
+        <settings>
619
+          <artifact-editor />
620
+          <splitter-proportions>
621
+            <option name="proportions">
622
+              <list>
623
+                <option value="0.2" />
624
+              </list>
625
+            </option>
626
+          </splitter-proportions>
627
+        </settings>
628
+      </state>
629
+      <state key="FacetStructureConfigurable.UI">
630
+        <settings>
631
+          <last-edited>Spring</last-edited>
632
+          <splitter-proportions>
633
+            <option name="proportions">
634
+              <list>
635
+                <option value="0.2" />
636
+              </list>
637
+            </option>
638
+          </splitter-proportions>
639
+        </settings>
640
+      </state>
641
+      <state key="GlobalLibrariesConfigurable.UI">
642
+        <settings>
643
+          <splitter-proportions>
644
+            <option name="proportions">
645
+              <list>
646
+                <option value="0.2" />
647
+              </list>
648
+            </option>
649
+          </splitter-proportions>
650
+        </settings>
651
+      </state>
652
+      <state key="JdkListConfigurable.UI">
653
+        <settings>
654
+          <last-edited>1.8</last-edited>
655
+          <splitter-proportions>
656
+            <option name="proportions">
657
+              <list>
658
+                <option value="0.2" />
659
+              </list>
660
+            </option>
661
+          </splitter-proportions>
662
+        </settings>
663
+      </state>
664
+      <state key="ModuleStructureConfigurable.UI">
665
+        <settings>
666
+          <last-edited>blueCoin</last-edited>
667
+          <splitter-proportions>
668
+            <option name="proportions">
669
+              <list>
670
+                <option value="0.2" />
671
+                <option value="0.6" />
672
+              </list>
673
+            </option>
674
+          </splitter-proportions>
675
+        </settings>
676
+      </state>
677
+      <state key="ProjectJDKs.UI">
678
+        <settings>
679
+          <last-edited>1.8</last-edited>
680
+          <splitter-proportions>
681
+            <option name="proportions">
682
+              <list>
683
+                <option value="0.2" />
684
+              </list>
685
+            </option>
686
+          </splitter-proportions>
687
+        </settings>
688
+      </state>
689
+      <state key="ProjectLibrariesConfigurable.UI">
690
+        <settings>
691
+          <last-edited>Maven: antlr:antlr:2.7.7</last-edited>
692
+          <splitter-proportions>
693
+            <option name="proportions">
694
+              <list>
695
+                <option value="0.2" />
696
+              </list>
697
+            </option>
698
+          </splitter-proportions>
699
+        </settings>
700
+      </state>
701
+    </states>
702
+  </component>
703
+</project>

+ 57
- 0
pom.xml Datei anzeigen

@@ -0,0 +1,57 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns="http://maven.apache.org/POM/4.0.0"
3
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
+    <modelVersion>4.0.0</modelVersion>
6
+
7
+    <groupId>io.zipcoder</groupId>
8
+    <artifactId>blueCoin</artifactId>
9
+    <version>1.0-SNAPSHOT</version>
10
+    <parent>
11
+        <groupId>org.springframework.boot</groupId>
12
+        <artifactId>spring-boot-starter-parent</artifactId>
13
+        <version>1.5.3.RELEASE</version>
14
+        <relativePath/> <!-- lookup parent from repository -->
15
+    </parent>
16
+    <properties>
17
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
18
+        <start-class>io.zipcoder.blue_coin_application.BlueCoinApplication</start-class>
19
+        <java.version>1.7</java.version>
20
+    </properties>
21
+    <dependencies>
22
+        <dependency>
23
+            <groupId>org.springframework.boot</groupId>
24
+            <artifactId>spring-boot-starter-web</artifactId>
25
+        </dependency>
26
+        <dependency>
27
+            <groupId>org.springframework.boot</groupId>
28
+            <artifactId>spring-boot-starter-data-jpa</artifactId>
29
+        </dependency>
30
+        <dependency>
31
+            <groupId>org.springframework.boot</groupId>
32
+            <artifactId>spring-boot-starter-test</artifactId>
33
+            <scope>test</scope>
34
+        </dependency>
35
+        <dependency>
36
+            <groupId>org.hsqldb</groupId>
37
+            <artifactId>hsqldb</artifactId>
38
+            <scope>runtime</scope>
39
+        </dependency>
40
+        <dependency>
41
+            <groupId>com.bluecatcode.guava</groupId>
42
+            <artifactId>guava-19.0-extended</artifactId>
43
+            <version>LATEST</version>
44
+        </dependency>
45
+        <dependency>
46
+            <groupId>javax.inject</groupId>
47
+            <artifactId>javax.inject</artifactId>
48
+            <version>1</version>
49
+        </dependency>
50
+        <dependency>
51
+            <groupId>com.google.code.gson</groupId>
52
+            <artifactId>gson</artifactId>
53
+        </dependency>
54
+    </dependencies>
55
+
56
+
57
+</project>

+ 4
- 0
src/main/java/io/zipcoder/blue_coin_application/BlueCoinApplication.java Datei anzeigen

@@ -0,0 +1,4 @@
1
+package io.zipcoder.blue_coin_application;
2
+
3
+public class BlueCoinApplication {
4
+}

+ 39
- 0
src/main/java/io/zipcoder/blue_coin_application/model/Block.java Datei anzeigen

@@ -0,0 +1,39 @@
1
+package io.zipcoder.blue_coin_application.model;
2
+
3
+import io.zipcoder.blue_coin_application.utility.Encryption;
4
+
5
+import java.util.Date;
6
+
7
+public class Block {
8
+    private String hash;
9
+    private String previousHash;
10
+    private String data;
11
+    private long timeStamp;
12
+
13
+    public Block(String data, String previousHash) {
14
+        this.data = data;
15
+        this.previousHash = previousHash;
16
+        this.timeStamp = new Date().getTime();
17
+        this.hash = calculateHash();
18
+    }
19
+
20
+    public String getHash() {
21
+        return hash;
22
+    }
23
+
24
+    public String getPreviousHash() {
25
+        return previousHash;
26
+    }
27
+
28
+    public String getData() {
29
+        return data;
30
+    }
31
+
32
+    public long getTimeStamp() {
33
+        return timeStamp;
34
+    }
35
+
36
+    public String calculateHash() {
37
+        return Encryption.applySha256(previousHash + Long.toString(timeStamp) + data);
38
+    }
39
+}

+ 49
- 0
src/main/java/io/zipcoder/blue_coin_application/model/Blockchain.java Datei anzeigen

@@ -0,0 +1,49 @@
1
+package io.zipcoder.blue_coin_application.model;
2
+
3
+import com.google.gson.GsonBuilder;
4
+
5
+import java.util.ArrayList;
6
+import java.util.List;
7
+
8
+public class Blockchain {
9
+    private static List<Block> blockchain = new ArrayList<>();
10
+
11
+    public String chainToJson() {
12
+        return new GsonBuilder()
13
+                .setPrettyPrinting()
14
+                .create()
15
+                .toJson(blockchain);
16
+    }
17
+
18
+    public static List<Block> getBlockchain() {
19
+        return blockchain;
20
+    }
21
+
22
+    public static void abbBlockToChain(Block block) {
23
+        blockchain.add(block);
24
+    }
25
+
26
+    public static Block getBlockFromChain(int i) {
27
+        return blockchain.get(i);
28
+    }
29
+
30
+    public static int getChainSize() {
31
+        return blockchain.size();
32
+    }
33
+
34
+    public static boolean isChainValid() {
35
+        Block currentBlock;
36
+        Block previousBlock;
37
+        for (int i = 1; i < blockchain.size()-1; i++) {
38
+            currentBlock = blockchain.get(i);
39
+            previousBlock = blockchain.get(i-1);
40
+            if(!currentBlock.getHash().equals(currentBlock.calculateHash())) {
41
+                return false;
42
+            }
43
+            if(!previousBlock.getHash().equals(currentBlock.getPreviousHash())) {
44
+                return false;
45
+            }
46
+        }
47
+        return true;
48
+    }
49
+}

+ 13
- 0
src/main/java/io/zipcoder/blue_coin_application/utility/Encryption.java Datei anzeigen

@@ -0,0 +1,13 @@
1
+package io.zipcoder.blue_coin_application.utility;
2
+
3
+import com.google.common.hash.Hashing;
4
+
5
+import java.nio.charset.StandardCharsets;
6
+
7
+public class Encryption {
8
+    public static String applySha256(String input) {
9
+        return Hashing.sha256()
10
+                .hashString(input, StandardCharsets.UTF_8)
11
+                .toString();
12
+    }
13
+}

+ 22
- 0
src/test/java/io/zipcoder/blue_coin_application/TestBlock.java Datei anzeigen

@@ -0,0 +1,22 @@
1
+package io.zipcoder.blue_coin_application;
2
+
3
+import io.zipcoder.blue_coin_application.model.Block;
4
+import org.junit.*;
5
+
6
+public class TestBlock {
7
+
8
+    @Test
9
+    public void testCalculateHash() {
10
+        Block block = new Block("data to encrypt", "dsgvcv4a534ghfgcvvw45ttb");
11
+        int actual = block.calculateHash().length();
12
+        Assert.assertEquals(64, actual);
13
+    }
14
+
15
+    @Test
16
+    public void testGetHash() {
17
+        Block block = new Block("more data to encrypt", "esfvdghfw546w5rtsw465gvfd");
18
+        String expected = block.calculateHash();
19
+        String actual = block.getHash();
20
+        Assert.assertEquals(expected, actual);
21
+    }
22
+}

+ 31
- 0
src/test/java/io/zipcoder/blue_coin_application/TestBlockchain.java Datei anzeigen

@@ -0,0 +1,31 @@
1
+package io.zipcoder.blue_coin_application;
2
+
3
+import io.zipcoder.blue_coin_application.model.Block;
4
+import io.zipcoder.blue_coin_application.model.Blockchain;
5
+import org.junit.Assert;
6
+import org.junit.Before;
7
+import org.junit.Test;
8
+
9
+public class TestBlockchain {
10
+
11
+    @Before
12
+    public void initialize() {
13
+        Blockchain.abbBlockToChain(new Block("any data to add to block goes here", "0"));
14
+        Blockchain.abbBlockToChain(new Block("probably transactions in our case", (Blockchain.getBlockFromChain(Blockchain.getChainSize()-1)).getHash()));
15
+        Blockchain.abbBlockToChain(new Block("are you looking at my test, Mexi?", (Blockchain.getBlockFromChain(Blockchain.getChainSize()-1)).getHash()));
16
+    }
17
+
18
+    @Test
19
+    public void testAddBlockToChain() {
20
+        int expected = 3;
21
+        int actual = Blockchain.getChainSize();
22
+        Assert.assertEquals(expected, actual);
23
+    }
24
+
25
+    @Test
26
+    public void testIsChainValid() {
27
+        boolean actual = Blockchain.isChainValid();
28
+        Assert.assertTrue(actual);
29
+    }
30
+
31
+}

BIN
target/classes/io/zipcoder/blue_coin_application/BlueCoinApplication.class Datei anzeigen


BIN
target/classes/io/zipcoder/blue_coin_application/model/Block.class Datei anzeigen


BIN
target/classes/io/zipcoder/blue_coin_application/model/Blockchain.class Datei anzeigen


BIN
target/classes/io/zipcoder/blue_coin_application/utility/Encryption.class Datei anzeigen


BIN
target/test-classes/io/zipcoder/blue_coin_application/TestBlock.class Datei anzeigen


BIN
target/test-classes/io/zipcoder/blue_coin_application/TestBlockchain.class Datei anzeigen