Browse Source

most working back end, codnductTransactionsmoney transfer method needs refactor

BlackJack 6 years ago
parent
commit
3482d52bf4

+ 242
- 211
.idea/workspace.xml View File

@@ -3,7 +3,25 @@
3 3
   <component name="ChangeListManager">
4 4
     <list default="true" id="86492085-3833-4394-8353-122bd8bc6cb0" name="Default" comment="">
5 5
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
6
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/buecoin01/ProcessLoader.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/buecoin01/ProcessLoader.java" afterDir="false" />
7
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/buecoin01/Repositories/TransactionRepository.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/buecoin01/Repositories/TransactionRepository.java" afterDir="false" />
8
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/buecoin01/Repositories/WalletRepository.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/buecoin01/Repositories/WalletRepository.java" afterDir="false" />
9
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/buecoin01/controller/BlockController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/buecoin01/controller/BlockController.java" afterDir="false" />
10
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/buecoin01/controller/ConductTransactions.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/buecoin01/controller/ConductTransactions.java" afterDir="false" />
6 11
       <change beforePath="$PROJECT_DIR$/src/main/java/com/buecoin01/controller/TransactionController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/buecoin01/controller/TransactionController.java" afterDir="false" />
12
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/buecoin01/model/Block.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/buecoin01/model/Block.java" afterDir="false" />
13
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/buecoin01/model/Transactions.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/buecoin01/model/Transactions.java" afterDir="false" />
14
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/buecoin01/model/Wallet.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/buecoin01/model/Wallet.java" afterDir="false" />
15
+      <change beforePath="$PROJECT_DIR$/src/main/resources/application.properties" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/application.properties" afterDir="false" />
16
+      <change beforePath="$PROJECT_DIR$/target/classes/application.properties" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/application.properties" afterDir="false" />
17
+      <change beforePath="$PROJECT_DIR$/target/classes/com/buecoin01/ProcessLoader.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/buecoin01/ProcessLoader.class" afterDir="false" />
18
+      <change beforePath="$PROJECT_DIR$/target/classes/com/buecoin01/Repositories/WalletRepository.class" beforeDir="false" />
19
+      <change beforePath="$PROJECT_DIR$/target/classes/com/buecoin01/controller/BlockController$UserController.class" beforeDir="false" />
20
+      <change beforePath="$PROJECT_DIR$/target/classes/com/buecoin01/controller/BlockController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/buecoin01/controller/BlockController.class" afterDir="false" />
21
+      <change beforePath="$PROJECT_DIR$/target/classes/com/buecoin01/controller/ConductTransactions.class" beforeDir="false" />
22
+      <change beforePath="$PROJECT_DIR$/target/classes/com/buecoin01/controller/TransactionController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/buecoin01/controller/TransactionController.class" afterDir="false" />
23
+      <change beforePath="$PROJECT_DIR$/target/classes/com/buecoin01/model/Block.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/buecoin01/model/Block.class" afterDir="false" />
24
+      <change beforePath="$PROJECT_DIR$/target/classes/com/buecoin01/model/Wallet.class" beforeDir="false" />
7 25
     </list>
8 26
     <ignored path="$PROJECT_DIR$/target/" />
9 27
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@@ -13,13 +31,27 @@
13 31
     <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
14 32
     <option name="LAST_RESOLUTION" value="IGNORE" />
15 33
   </component>
34
+  <component name="DatabaseView">
35
+    <option name="SHOW_INTERMEDIATE" value="true" />
36
+    <option name="GROUP_DATA_SOURCES" value="true" />
37
+    <option name="GROUP_SCHEMA" value="true" />
38
+    <option name="GROUP_CONTENTS" value="false" />
39
+    <option name="SORT_POSITIONED" value="false" />
40
+    <option name="SHOW_EMPTY_GROUPS" value="false" />
41
+    <option name="AUTO_SCROLL_FROM_SOURCE" value="false" />
42
+    <option name="HIDDEN_KINDS">
43
+      <set />
44
+    </option>
45
+    <expand />
46
+    <select />
47
+  </component>
16 48
   <component name="FileEditorManager">
17
-    <leaf>
18
-      <file leaf-file-name="Wallet.java" pinned="false" current-in-tab="false">
19
-        <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/model/Wallet.java">
49
+    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
50
+      <file leaf-file-name="TransactionController.java" pinned="false" current-in-tab="true">
51
+        <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/controller/TransactionController.java">
20 52
           <provider selected="true" editor-type-id="text-editor">
21
-            <state relative-caret-position="139">
22
-              <caret line="16" lean-forward="true" selection-start-line="16" selection-end-line="16" />
53
+            <state relative-caret-position="430">
54
+              <caret line="47" column="58" lean-forward="true" selection-start-line="47" selection-start-column="58" selection-end-line="47" selection-end-column="58" />
23 55
               <folding>
24 56
                 <element signature="imports" expanded="true" />
25 57
               </folding>
@@ -27,32 +59,34 @@
27 59
           </provider>
28 60
         </entry>
29 61
       </file>
30
-      <file leaf-file-name="ConductTransactions.java" pinned="false" current-in-tab="false">
31
-        <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/controller/ConductTransactions.java">
62
+      <file leaf-file-name="Transactions.java" pinned="false" current-in-tab="false">
63
+        <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/model/Transactions.java">
32 64
           <provider selected="true" editor-type-id="text-editor">
33
-            <state relative-caret-position="480">
34
-              <caret line="34" column="38" selection-start-line="34" selection-start-column="38" selection-end-line="34" selection-end-column="38" />
65
+            <state relative-caret-position="132">
66
+              <caret line="9" column="13" selection-start-line="9" selection-start-column="13" selection-end-line="9" selection-end-column="13" />
35 67
               <folding>
36 68
                 <element signature="imports" expanded="true" />
69
+                <element signature="e#1108#1109#0" expanded="true" />
70
+                <element signature="e#1137#1138#0" expanded="true" />
37 71
               </folding>
38 72
             </state>
39 73
           </provider>
40 74
         </entry>
41 75
       </file>
42
-      <file leaf-file-name="Application.java" pinned="false" current-in-tab="false">
43
-        <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/Application.java">
76
+      <file leaf-file-name="Block.java" pinned="false" current-in-tab="false">
77
+        <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/model/Block.java">
44 78
           <provider selected="true" editor-type-id="text-editor">
45
-            <state relative-caret-position="60">
46
-              <caret line="6" column="22" selection-start-line="6" selection-start-column="22" selection-end-line="6" selection-end-column="22" />
79
+            <state relative-caret-position="15">
80
+              <caret line="12" column="10" selection-start-line="12" selection-start-column="10" selection-end-line="12" selection-end-column="10" />
47 81
             </state>
48 82
           </provider>
49 83
         </entry>
50 84
       </file>
51
-      <file leaf-file-name="WalletController.java" pinned="false" current-in-tab="false">
52
-        <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/controller/WalletController.java">
85
+      <file leaf-file-name="ConductTransactions.java" pinned="false" current-in-tab="false">
86
+        <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/controller/ConductTransactions.java">
53 87
           <provider selected="true" editor-type-id="text-editor">
54
-            <state relative-caret-position="258">
55
-              <caret line="26" column="71" lean-forward="true" selection-start-line="26" selection-start-column="71" selection-end-line="26" selection-end-column="71" />
88
+            <state relative-caret-position="292">
89
+              <caret line="34" column="77" selection-start-line="34" selection-start-column="77" selection-end-line="34" selection-end-column="77" />
56 90
               <folding>
57 91
                 <element signature="imports" expanded="true" />
58 92
               </folding>
@@ -60,23 +94,20 @@
60 94
           </provider>
61 95
         </entry>
62 96
       </file>
63
-      <file leaf-file-name="ProcessLoader.java" pinned="false" current-in-tab="false">
64
-        <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/ProcessLoader.java">
97
+      <file leaf-file-name="BlockController.java" pinned="false" current-in-tab="false">
98
+        <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/controller/BlockController.java">
65 99
           <provider selected="true" editor-type-id="text-editor">
66
-            <state relative-caret-position="583">
67
-              <caret line="30" column="29" lean-forward="true" selection-start-line="30" selection-start-column="29" selection-end-line="30" selection-end-column="29" />
68
-              <folding>
69
-                <element signature="imports" expanded="true" />
70
-              </folding>
100
+            <state relative-caret-position="660">
101
+              <caret line="51" column="1" lean-forward="true" selection-start-line="51" selection-start-column="1" selection-end-line="51" selection-end-column="1" />
71 102
             </state>
72 103
           </provider>
73 104
         </entry>
74 105
       </file>
75
-      <file leaf-file-name="TransactionController.java" pinned="false" current-in-tab="false">
76
-        <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/controller/TransactionController.java">
106
+      <file leaf-file-name="Wallet.java" pinned="false" current-in-tab="false">
107
+        <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/model/Wallet.java">
77 108
           <provider selected="true" editor-type-id="text-editor">
78
-            <state relative-caret-position="7">
79
-              <caret line="13" selection-start-line="13" selection-end-line="13" />
109
+            <state relative-caret-position="229">
110
+              <caret line="18" column="28" lean-forward="true" selection-start-line="18" selection-start-column="28" selection-end-line="18" selection-end-column="28" />
80 111
               <folding>
81 112
                 <element signature="imports" expanded="true" />
82 113
               </folding>
@@ -84,11 +115,11 @@
84 115
           </provider>
85 116
         </entry>
86 117
       </file>
87
-      <file leaf-file-name="Transactions.java" pinned="false" current-in-tab="true">
88
-        <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/model/Transactions.java">
118
+      <file leaf-file-name="WalletRepository.java" pinned="false" current-in-tab="false">
119
+        <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/Repositories/WalletRepository.java">
89 120
           <provider selected="true" editor-type-id="text-editor">
90
-            <state relative-caret-position="579">
91
-              <caret line="77" column="5" lean-forward="true" selection-start-line="77" selection-start-column="5" selection-end-line="77" selection-end-column="5" />
121
+            <state relative-caret-position="195">
122
+              <caret line="13" column="17" selection-start-line="13" selection-start-column="17" selection-end-line="13" selection-end-column="17" />
92 123
               <folding>
93 124
                 <element signature="imports" expanded="true" />
94 125
               </folding>
@@ -96,15 +127,6 @@
96 127
           </provider>
97 128
         </entry>
98 129
       </file>
99
-      <file leaf-file-name="application.properties" pinned="false" current-in-tab="false">
100
-        <entry file="file://$PROJECT_DIR$/src/main/resources/application.properties">
101
-          <provider selected="true" editor-type-id="text-editor">
102
-            <state relative-caret-position="30">
103
-              <caret line="2" column="44" selection-start-line="2" selection-start-column="42" selection-end-line="2" selection-end-column="44" />
104
-            </state>
105
-          </provider>
106
-        </entry>
107
-      </file>
108 130
     </leaf>
109 131
   </component>
110 132
   <component name="FileTemplateManagerImpl">
@@ -119,6 +141,7 @@
119 141
   <component name="FindInProjectRecents">
120 142
     <findStrings>
121 143
       <find>WalletRepository</find>
144
+      <find>testWhileIdle</find>
122 145
     </findStrings>
123 146
     <replaceStrings>
124 147
       <replace>TransactionRepository</replace>
@@ -131,20 +154,22 @@
131 154
   <component name="IdeDocumentHistory">
132 155
     <option name="CHANGED_PATHS">
133 156
       <list>
134
-        <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/Repositories/WalletRepository.java" />
135
-        <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/controller/BlockController.java" />
136 157
         <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/model/BlockchainVerification.java" />
137 158
         <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/model/Transaction.java" />
138
-        <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/Repositories/TransactionRepository.java" />
139 159
         <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/EnableMongoRepositories.java" />
140 160
         <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/Application.java" />
161
+        <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/ProcessLoader.java" />
162
+        <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/controller/BlockController.java" />
141 163
         <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/model/Block.java" />
142 164
         <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/controller/WalletController.java" />
143
-        <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/ProcessLoader.java" />
165
+        <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/Repositories/TransactionRepository.java" />
144 166
         <option value="$PROJECT_DIR$/src/main/resources/application.properties" />
167
+        <option value="$APPLICATION_CONFIG_DIR$/consoles/db/9e5d39f9-b664-4d5a-a0eb-fa8b2386a1ce/console.sql" />
145 168
         <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/model/Wallet.java" />
146
-        <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/controller/ConductTransactions.java" />
169
+        <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/utility/Encryption.java" />
147 170
         <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/model/Transactions.java" />
171
+        <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/Repositories/WalletRepository.java" />
172
+        <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/controller/ConductTransactions.java" />
148 173
         <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/controller/TransactionController.java" />
149 174
       </list>
150 175
     </option>
@@ -165,8 +190,8 @@
165 190
   <component name="NodePackageJsonFileManager">
166 191
     <packageJsonPaths />
167 192
   </component>
168
-  <component name="ProjectFrameBounds" fullScreen="true">
169
-    <option name="x" value="-213" />
193
+  <component name="ProjectFrameBounds" extendedState="6" fullScreen="true">
194
+    <option name="x" value="-372" />
170 195
     <option name="y" value="-1080" />
171 196
     <option name="width" value="1920" />
172 197
     <option name="height" value="1080" />
@@ -177,9 +202,9 @@
177 202
       <foldersAlwaysOnTop value="true" />
178 203
     </navigator>
179 204
     <panes>
180
-      <pane id="AndroidView" />
181 205
       <pane id="PackagesPane" />
182 206
       <pane id="Scope" />
207
+      <pane id="AndroidView" />
183 208
       <pane id="ProjectPane">
184 209
         <subPane>
185 210
           <expand>
@@ -219,7 +244,6 @@
219 244
               <item name="src" type="462c0819:PsiDirectoryNode" />
220 245
               <item name="main" type="462c0819:PsiDirectoryNode" />
221 246
               <item name="java" type="462c0819:PsiDirectoryNode" />
222
-              <item name="buecoin01" type="462c0819:PsiDirectoryNode" />
223 247
               <item name="controller" type="462c0819:PsiDirectoryNode" />
224 248
             </path>
225 249
             <path>
@@ -228,7 +252,6 @@
228 252
               <item name="src" type="462c0819:PsiDirectoryNode" />
229 253
               <item name="main" type="462c0819:PsiDirectoryNode" />
230 254
               <item name="java" type="462c0819:PsiDirectoryNode" />
231
-              <item name="buecoin01" type="462c0819:PsiDirectoryNode" />
232 255
               <item name="model" type="462c0819:PsiDirectoryNode" />
233 256
             </path>
234 257
             <path>
@@ -236,6 +259,22 @@
236 259
               <item name="CryptoCoin" type="462c0819:PsiDirectoryNode" />
237 260
               <item name="src" type="462c0819:PsiDirectoryNode" />
238 261
               <item name="main" type="462c0819:PsiDirectoryNode" />
262
+              <item name="java" type="462c0819:PsiDirectoryNode" />
263
+              <item name="Repositories" type="462c0819:PsiDirectoryNode" />
264
+            </path>
265
+            <path>
266
+              <item name="0.1" type="b2602c69:ProjectViewProjectNode" />
267
+              <item name="CryptoCoin" type="462c0819:PsiDirectoryNode" />
268
+              <item name="src" type="462c0819:PsiDirectoryNode" />
269
+              <item name="main" type="462c0819:PsiDirectoryNode" />
270
+              <item name="java" type="462c0819:PsiDirectoryNode" />
271
+              <item name="utility" type="462c0819:PsiDirectoryNode" />
272
+            </path>
273
+            <path>
274
+              <item name="0.1" type="b2602c69:ProjectViewProjectNode" />
275
+              <item name="CryptoCoin" type="462c0819:PsiDirectoryNode" />
276
+              <item name="src" type="462c0819:PsiDirectoryNode" />
277
+              <item name="main" type="462c0819:PsiDirectoryNode" />
239 278
               <item name="resources" type="462c0819:PsiDirectoryNode" />
240 279
             </path>
241 280
           </expand>
@@ -251,6 +290,8 @@
251 290
     <property name="RequestMappingsPanelWidth1" value="75" />
252 291
     <property name="WebServerToolWindowFactoryState" value="false" />
253 292
     <property name="aspect.path.notification.shown" value="true" />
293
+    <property name="com.intellij.database.dataSource.DataSourceTemplate" value="MySQL" />
294
+    <property name="database.console.LAST_STATE" value="true" />
254 295
     <property name="last_opened_file_path" value="$PROJECT_DIR$" />
255 296
     <property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
256 297
   </component>
@@ -350,106 +391,85 @@
350 391
       <updated>1532357794192</updated>
351 392
       <workItem from="1532357795573" duration="4040000" />
352 393
       <workItem from="1532473422589" duration="716000" />
394
+      <workItem from="1533219920414" duration="25981000" />
353 395
     </task>
354 396
     <servers />
355 397
   </component>
356 398
   <component name="TimeTrackingManager">
357
-    <option name="totallyTimeSpent" value="16177000" />
399
+    <option name="totallyTimeSpent" value="44474000" />
358 400
   </component>
359 401
   <component name="ToolWindowManager">
360
-    <frame x="-213" y="-1080" width="1920" height="1080" extended-state="0" />
402
+    <frame x="-372" y="-1080" width="1920" height="1080" extended-state="6" />
403
+    <editor active="true" />
361 404
     <layout>
362
-      <window_info anchor="right" id="Palette" />
363
-      <window_info anchor="bottom" id="Event Log" side_tool="true" />
364
-      <window_info anchor="right" id="Maven Projects" />
365
-      <window_info anchor="bottom" id="Database Changes" show_stripe_button="false" />
366
-      <window_info id="Capture Tool" />
367
-      <window_info id="Designer" />
368
-      <window_info anchor="right" id="Database" />
405
+      <window_info anchor="right" id="Palette" order="3" />
406
+      <window_info anchor="bottom" id="Event Log" order="14" sideWeight="0.5005325" side_tool="true" weight="0.43383086" />
407
+      <window_info anchor="right" id="Maven Projects" order="5" />
408
+      <window_info anchor="bottom" id="Database Changes" order="12" show_stripe_button="false" />
409
+      <window_info id="Capture Tool" order="7" />
410
+      <window_info id="Designer" order="2" />
411
+      <window_info anchor="right" id="Database" order="6" weight="0.10915868" />
369 412
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
370 413
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
371
-      <window_info id="UI Designer" />
372
-      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
373
-      <window_info anchor="bottom" id="TODO" order="6" />
374
-      <window_info anchor="bottom" id="Messages" />
375
-      <window_info anchor="right" id="Palette&#9;" />
376
-      <window_info id="Image Layers" />
377
-      <window_info anchor="bottom" id="Java Enterprise" />
378
-      <window_info anchor="right" id="Capture Analysis" />
379
-      <window_info anchor="bottom" id="Run" order="2" visible="true" weight="0.32892057" />
380
-      <window_info anchor="bottom" id="Version Control" />
381
-      <window_info anchor="bottom" id="Spring" />
382
-      <window_info anchor="bottom" id="Terminal" weight="0.23727088" />
383
-      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.185836" />
384
-      <window_info anchor="right" id="Bean Validation" />
385
-      <window_info id="Web" side_tool="true" />
386
-      <window_info anchor="right" id="Theme Preview" />
387
-      <window_info id="Favorites" side_tool="true" />
388
-      <window_info id="Designer" order="5" />
389
-      <window_info anchor="right" id="Palette" order="6" />
390
-      <window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.3299389" />
391
-      <window_info anchor="bottom" id="Spring" order="10" />
392
-      <window_info id="Image Layers" order="5" />
414
+      <window_info id="UI Designer" order="4" />
415
+      <window_info anchor="bottom" id="Debug" order="4" weight="0.4" />
416
+      <window_info anchor="bottom" id="TODO" order="7" />
417
+      <window_info anchor="bottom" id="Messages" order="8" weight="0.27462685" />
418
+      <window_info anchor="right" id="Palette&#9;" order="7" />
419
+      <window_info id="Image Layers" order="3" />
420
+      <window_info anchor="bottom" id="Java Enterprise" order="11" />
421
+      <window_info anchor="right" id="Capture Analysis" order="4" />
422
+      <window_info anchor="bottom" id="Version Control" order="13" />
423
+      <window_info active="true" anchor="bottom" id="Run" order="3" sideWeight="0.49946752" visible="true" weight="0.43383086" />
424
+      <window_info anchor="bottom" id="Spring" order="9" weight="0.32935324" />
425
+      <window_info anchor="bottom" id="Terminal" order="10" weight="0.32965517" />
426
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.17092651" />
427
+      <window_info anchor="right" id="Bean Validation" order="9" />
428
+      <window_info id="Web" order="6" side_tool="true" />
429
+      <window_info anchor="bottom" id="Find" order="2" />
430
+      <window_info anchor="right" id="Theme Preview" order="8" />
431
+      <window_info id="Favorites" order="5" side_tool="true" />
432
+      <window_info anchor="bottom" id="Inspection" order="6" weight="0.4" />
433
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
434
+      <window_info anchor="bottom" id="Database Console" order="0" weight="0.32935324" />
435
+      <window_info anchor="bottom" id="Cvs" order="5" weight="0.25" />
436
+      <window_info anchor="bottom" id="Message" order="1" />
437
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
438
+    </layout>
439
+    <layout-to-restore>
440
+      <window_info id="Designer" order="2" />
441
+      <window_info anchor="bottom" id="Database Console" order="0" weight="0.32935324" />
442
+      <window_info anchor="right" id="Palette" order="3" />
443
+      <window_info active="true" anchor="bottom" id="Run" order="3" sideWeight="0.49946752" visible="true" weight="0.43383086" />
444
+      <window_info anchor="bottom" id="Spring" order="9" />
445
+      <window_info id="Image Layers" order="3" />
393 446
       <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
394
-      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
447
+      <window_info anchor="bottom" id="Cvs" order="5" weight="0.25" />
395 448
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
396
-      <window_info id="UI Designer" order="5" />
449
+      <window_info id="UI Designer" order="4" />
397 450
       <window_info id="Favorites" order="5" side_tool="true" />
398
-      <window_info anchor="bottom" id="Terminal" order="10" />
399
-      <window_info id="Capture Tool" order="5" />
400
-      <window_info anchor="right" id="Capture Analysis" order="6" />
401
-      <window_info anchor="bottom" id="Event Log" order="10" side_tool="true" />
402
-      <window_info anchor="bottom" id="Messages" order="9" weight="0.27492878" />
403
-      <window_info anchor="bottom" id="TODO" order="6" />
451
+      <window_info anchor="bottom" id="Terminal" order="10" weight="0.32965517" />
452
+      <window_info id="Capture Tool" order="7" />
453
+      <window_info anchor="right" id="Capture Analysis" order="4" />
454
+      <window_info anchor="bottom" id="Event Log" order="14" sideWeight="0.5005325" side_tool="true" weight="0.43383086" />
455
+      <window_info anchor="bottom" id="Messages" order="8" weight="0.27462685" />
456
+      <window_info anchor="bottom" id="TODO" order="7" />
404 457
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
405
-      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.30298188" />
406
-      <window_info anchor="bottom" id="Java Enterprise" order="10" />
407
-      <window_info anchor="bottom" id="Database Changes" order="10" show_stripe_button="false" />
408
-      <window_info anchor="bottom" id="Version Control" order="10" />
409
-      <window_info anchor="right" id="Maven Projects" order="6" />
410
-      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
411
-      <window_info anchor="right" id="Database" order="6" />
412
-      <window_info anchor="bottom" id="Message" order="0" />
413
-      <window_info id="Web" order="5" side_tool="true" />
414
-      <window_info anchor="right" id="Palette&#9;" order="6" />
415
-      <window_info anchor="right" id="Theme Preview" order="6" />
458
+      <window_info anchor="bottom" id="Java Enterprise" order="11" />
459
+      <window_info anchor="bottom" id="Database Changes" order="12" show_stripe_button="false" />
460
+      <window_info anchor="bottom" id="Version Control" order="13" />
461
+      <window_info anchor="right" id="Maven Projects" order="5" />
462
+      <window_info anchor="bottom" id="Find" order="2" />
463
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.17092651" />
464
+      <window_info anchor="right" id="Database" order="6" weight="0.10915868" />
465
+      <window_info anchor="bottom" id="Message" order="1" />
466
+      <window_info id="Web" order="6" side_tool="true" />
467
+      <window_info anchor="right" id="Palette&#9;" order="7" />
468
+      <window_info anchor="right" id="Theme Preview" order="8" />
416 469
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
417
-      <window_info anchor="bottom" id="Find" order="1" />
418
-      <window_info anchor="right" id="Bean Validation" order="6" />
419
-      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
420
-    </layout>
421
-    <layout-to-restore>
422
-      <window_info id="Designer" order="0" />
423
-      <window_info anchor="right" id="Palette" order="0" />
424
-      <window_info anchor="bottom" id="Spring" order="0" />
425
-      <window_info id="Image Layers" order="1" />
426
-      <window_info anchor="bottom" id="Run" order="8" />
427
-      <window_info anchor="bottom" id="Cvs" order="10" weight="0.25" />
428
-      <window_info anchor="right" id="Ant Build" order="8" weight="0.25" />
429
-      <window_info id="UI Designer" order="2" />
430
-      <window_info id="Favorites" order="3" side_tool="true" />
431
-      <window_info anchor="bottom" id="Terminal" order="1" />
432
-      <window_info id="Capture Tool" order="4" />
433
-      <window_info anchor="right" id="Capture Analysis" order="1" />
434
-      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="7" type="SLIDING" weight="0.4" />
435
-      <window_info anchor="bottom" id="Event Log" order="2" side_tool="true" />
436
-      <window_info anchor="bottom" id="TODO" order="12" />
437
-      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="9" weight="0.25" />
438
-      <window_info anchor="bottom" id="Java Enterprise" order="3" />
439
-      <window_info anchor="bottom" id="Database Changes" order="4" show_stripe_button="false" />
440
-      <window_info anchor="bottom" id="Version Control" order="5" />
441
-      <window_info anchor="right" id="Maven Projects" order="2" />
442
-      <window_info anchor="bottom" id="Find" order="7" />
443
-      <window_info active="true" content_ui="combo" id="Project" order="6" visible="true" weight="0.24973376" />
444
-      <window_info anchor="right" id="Database" order="3" />
445
-      <window_info anchor="bottom" id="Message" order="6" />
446
-      <window_info id="Web" order="5" side_tool="true" />
447
-      <window_info anchor="right" id="Palette&#9;" order="4" />
448
-      <window_info anchor="right" id="Theme Preview" order="5" />
449
-      <window_info id="Structure" order="7" side_tool="true" weight="0.25" />
450
-      <window_info anchor="bottom" id="Inspection" order="11" weight="0.4" />
451
-      <window_info anchor="bottom" id="Debug" order="9" weight="0.4" />
452
-      <window_info anchor="right" id="Bean Validation" order="6" />
470
+      <window_info anchor="bottom" id="Inspection" order="6" weight="0.4" />
471
+      <window_info anchor="bottom" id="Debug" order="4" weight="0.4" />
472
+      <window_info anchor="right" id="Bean Validation" order="9" />
453 473
     </layout-to-restore>
454 474
   </component>
455 475
   <component name="TypeScriptGeneratedFilesManager">
@@ -458,8 +478,12 @@
458 478
   <component name="VcsContentAnnotationSettings">
459 479
     <option name="myLimit" value="2678400000" />
460 480
   </component>
481
+  <component name="XDebuggerManager">
482
+    <breakpoint-manager>
483
+      <option name="time" value="1" />
484
+    </breakpoint-manager>
485
+  </component>
461 486
   <component name="editorHistoryManager">
462
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/Repositories/CoinRepository.java" />
463 487
     <entry file="file://$PROJECT_DIR$/src/test/java/com/buecoin01/ApplicationTests.java">
464 488
       <provider selected="true" editor-type-id="text-editor">
465 489
         <state relative-caret-position="90">
@@ -471,10 +495,6 @@
471 495
       <provider selected="true" editor-type-id="text-editor">
472 496
         <state relative-caret-position="945">
473 497
           <caret line="78" selection-start-line="78" selection-end-line="78" />
474
-          <folding>
475
-            <element signature="e#969#970#0" expanded="true" />
476
-            <element signature="e#996#997#0" expanded="true" />
477
-          </folding>
478 498
         </state>
479 499
       </provider>
480 500
     </entry>
@@ -586,34 +606,6 @@
586 606
       <provider selected="true" editor-type-id="text-editor">
587 607
         <state relative-caret-position="318">
588 608
           <caret line="117" column="26" selection-start-line="117" selection-start-column="26" selection-end-line="117" selection-end-column="26" />
589
-          <folding>
590
-            <element signature="imports" expanded="true" />
591
-          </folding>
592
-        </state>
593
-      </provider>
594
-    </entry>
595
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/utility/TransactionInput.java">
596
-      <provider selected="true" editor-type-id="text-editor">
597
-        <state relative-caret-position="120">
598
-          <caret line="8" column="10" selection-start-line="8" selection-start-column="10" selection-end-line="8" selection-end-column="10" />
599
-        </state>
600
-      </provider>
601
-    </entry>
602
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/utility/TransactionOutput.java">
603
-      <provider selected="true" editor-type-id="text-editor">
604
-        <state relative-caret-position="314">
605
-          <caret line="25" column="38" selection-start-line="25" selection-start-column="38" selection-end-line="25" selection-end-column="38" />
606
-        </state>
607
-      </provider>
608
-    </entry>
609
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/utility/Encryption.java">
610
-      <provider selected="true" editor-type-id="text-editor">
611
-        <state relative-caret-position="-26">
612
-          <caret line="18" column="49" selection-start-line="18" selection-start-column="49" selection-end-line="18" selection-end-column="49" />
613
-          <folding>
614
-            <element signature="imports" expanded="true" />
615
-            <element signature="e#1724#1725#0" expanded="true" />
616
-          </folding>
617 609
         </state>
618 610
       </provider>
619 611
     </entry>
@@ -659,121 +651,160 @@
659 651
       <provider selected="true" editor-type-id="text-editor" />
660 652
     </entry>
661 653
     <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/model/Coin.java" />
654
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/EnableMongoRepositories.java" />
662 655
     <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/model/BlockchainVerification.java">
663 656
       <provider selected="true" editor-type-id="text-editor">
664
-        <state relative-caret-position="285">
657
+        <state relative-caret-position="-144">
665 658
           <caret line="19" column="2" selection-start-line="19" selection-start-column="2" selection-end-line="19" selection-end-column="2" />
666 659
         </state>
667 660
       </provider>
668 661
     </entry>
669
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/EnableMongoRepositories.java" />
670
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/Repositories/BlockRepository.java">
662
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/ProcessLoader.java">
671 663
       <provider selected="true" editor-type-id="text-editor">
672
-        <state relative-caret-position="75">
673
-          <caret line="8" column="1" selection-start-line="8" selection-end-line="9" />
664
+        <state relative-caret-position="251">
665
+          <caret line="29" column="21" lean-forward="true" selection-start-line="29" selection-start-column="21" selection-end-line="29" selection-end-column="21" />
666
+          <folding>
667
+            <element signature="imports" expanded="true" />
668
+          </folding>
674 669
         </state>
675 670
       </provider>
676 671
     </entry>
677
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/controller/BlockController.java">
672
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/utility/TransactionInput.java">
678 673
       <provider selected="true" editor-type-id="text-editor">
679
-        <state relative-caret-position="639">
680
-          <caret line="47" column="40" selection-start-line="47" selection-start-column="40" selection-end-line="47" selection-end-column="40" />
674
+        <state relative-caret-position="120">
675
+          <caret line="8" column="10" selection-start-line="8" selection-start-column="10" selection-end-line="8" selection-end-column="10" />
681 676
         </state>
682 677
       </provider>
683 678
     </entry>
684
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/model/Block.java">
679
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/utility/TransactionOutput.java">
685 680
       <provider selected="true" editor-type-id="text-editor">
686
-        <state relative-caret-position="148">
687
-          <caret line="14" lean-forward="true" selection-start-line="14" selection-end-line="14" />
681
+        <state relative-caret-position="64">
682
+          <caret line="25" column="38" selection-start-line="25" selection-start-column="38" selection-end-line="25" selection-end-column="38" />
688 683
           <folding>
689
-            <element signature="e#969#970#0" expanded="true" />
690
-            <element signature="e#996#997#0" expanded="true" />
684
+            <element signature="e#813#814#0" expanded="true" />
691 685
           </folding>
692 686
         </state>
693 687
       </provider>
694 688
     </entry>
695
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/Repositories/WalletRepository.java">
689
+    <entry file="file://$APPLICATION_CONFIG_DIR$/consoles/db/9e5d39f9-b664-4d5a-a0eb-fa8b2386a1ce/console.sql">
696 690
       <provider selected="true" editor-type-id="text-editor">
697 691
         <state>
698
-          <caret column="35" lean-forward="true" selection-start-column="35" selection-end-column="35" />
692
+          <caret column="34" selection-start-column="34" selection-end-column="34" />
699 693
         </state>
700 694
       </provider>
701 695
     </entry>
702
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/Repositories/TransactionRepository.java">
696
+    <entry file="file://$PROJECT_DIR$/src/main/resources/application.properties">
703 697
       <provider selected="true" editor-type-id="text-editor">
704
-        <state relative-caret-position="90">
705
-          <caret line="6" column="59" lean-forward="true" selection-start-line="6" selection-start-column="59" selection-end-line="6" selection-end-column="59" />
698
+        <state relative-caret-position="150">
699
+          <caret line="10" lean-forward="true" selection-start-line="10" selection-end-line="10" />
706 700
         </state>
707 701
       </provider>
708 702
     </entry>
709
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/ProcessLoader.java">
703
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/Repositories/BlockRepository.java">
710 704
       <provider selected="true" editor-type-id="text-editor">
711
-        <state relative-caret-position="583">
712
-          <caret line="30" column="29" lean-forward="true" selection-start-line="30" selection-start-column="29" selection-end-line="30" selection-end-column="29" />
705
+        <state relative-caret-position="75">
706
+          <caret line="8" column="1" selection-start-line="8" selection-end-line="9" />
707
+        </state>
708
+      </provider>
709
+    </entry>
710
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/utility/Encryption.java">
711
+      <provider selected="true" editor-type-id="text-editor">
712
+        <state relative-caret-position="174">
713
+          <caret line="14" selection-start-line="14" selection-end-line="14" />
713 714
           <folding>
714 715
             <element signature="imports" expanded="true" />
716
+            <element signature="e#523#524#0" expanded="true" />
717
+            <element signature="e#597#598#0" expanded="true" />
718
+            <element signature="e#1661#1662#0" expanded="true" />
719
+            <element signature="e#1736#1737#0" expanded="true" />
715 720
           </folding>
716 721
         </state>
717 722
       </provider>
718 723
     </entry>
719
-    <entry file="file://$PROJECT_DIR$/src/main/resources/application.properties">
724
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/Application.java">
720 725
       <provider selected="true" editor-type-id="text-editor">
721
-        <state relative-caret-position="30">
722
-          <caret line="2" column="44" selection-start-line="2" selection-start-column="42" selection-end-line="2" selection-end-column="44" />
726
+        <state relative-caret-position="135">
727
+          <caret line="11" selection-start-line="11" selection-end-line="11" />
723 728
         </state>
724 729
       </provider>
725 730
     </entry>
726
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/Application.java">
731
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/controller/BlockController.java">
727 732
       <provider selected="true" editor-type-id="text-editor">
728
-        <state relative-caret-position="60">
729
-          <caret line="6" column="22" selection-start-line="6" selection-start-column="22" selection-end-line="6" selection-end-column="22" />
733
+        <state relative-caret-position="660">
734
+          <caret line="51" column="1" lean-forward="true" selection-start-line="51" selection-start-column="1" selection-end-line="51" selection-end-column="1" />
730 735
         </state>
731 736
       </provider>
732 737
     </entry>
733
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/model/Wallet.java">
738
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/Repositories/TransactionRepository.java">
734 739
       <provider selected="true" editor-type-id="text-editor">
735
-        <state relative-caret-position="139">
736
-          <caret line="16" lean-forward="true" selection-start-line="16" selection-end-line="16" />
740
+        <state relative-caret-position="165">
741
+          <caret line="11" column="17" selection-start-line="11" selection-start-column="17" selection-end-line="11" selection-end-column="17" />
737 742
           <folding>
738 743
             <element signature="imports" expanded="true" />
739 744
           </folding>
740 745
         </state>
741 746
       </provider>
742 747
     </entry>
743
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/controller/WalletController.java">
748
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/Repositories/WalletRepository.java">
744 749
       <provider selected="true" editor-type-id="text-editor">
745
-        <state relative-caret-position="258">
746
-          <caret line="26" column="71" lean-forward="true" selection-start-line="26" selection-start-column="71" selection-end-line="26" selection-end-column="71" />
750
+        <state relative-caret-position="195">
751
+          <caret line="13" column="17" selection-start-line="13" selection-start-column="17" selection-end-line="13" selection-end-column="17" />
747 752
           <folding>
748 753
             <element signature="imports" expanded="true" />
749 754
           </folding>
750 755
         </state>
751 756
       </provider>
752 757
     </entry>
753
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/controller/TransactionController.java">
758
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/model/Wallet.java">
759
+      <provider selected="true" editor-type-id="text-editor">
760
+        <state relative-caret-position="229">
761
+          <caret line="18" column="28" lean-forward="true" selection-start-line="18" selection-start-column="28" selection-end-line="18" selection-end-column="28" />
762
+          <folding>
763
+            <element signature="imports" expanded="true" />
764
+          </folding>
765
+        </state>
766
+      </provider>
767
+    </entry>
768
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/model/Transactions.java">
754 769
       <provider selected="true" editor-type-id="text-editor">
755
-        <state relative-caret-position="7">
756
-          <caret line="13" selection-start-line="13" selection-end-line="13" />
770
+        <state relative-caret-position="132">
771
+          <caret line="9" column="13" selection-start-line="9" selection-start-column="13" selection-end-line="9" selection-end-column="13" />
757 772
           <folding>
758 773
             <element signature="imports" expanded="true" />
774
+            <element signature="e#1108#1109#0" expanded="true" />
775
+            <element signature="e#1137#1138#0" expanded="true" />
759 776
           </folding>
760 777
         </state>
761 778
       </provider>
762 779
     </entry>
780
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/model/Block.java">
781
+      <provider selected="true" editor-type-id="text-editor">
782
+        <state relative-caret-position="15">
783
+          <caret line="12" column="10" selection-start-line="12" selection-start-column="10" selection-end-line="12" selection-end-column="10" />
784
+        </state>
785
+      </provider>
786
+    </entry>
787
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/controller/WalletController.java">
788
+      <provider selected="true" editor-type-id="text-editor">
789
+        <state relative-caret-position="393">
790
+          <caret line="41" column="4" lean-forward="true" selection-start-line="41" selection-start-column="4" selection-end-line="41" selection-end-column="4" />
791
+        </state>
792
+      </provider>
793
+    </entry>
763 794
     <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/controller/ConductTransactions.java">
764 795
       <provider selected="true" editor-type-id="text-editor">
765
-        <state relative-caret-position="480">
766
-          <caret line="34" column="38" selection-start-line="34" selection-start-column="38" selection-end-line="34" selection-end-column="38" />
796
+        <state relative-caret-position="292">
797
+          <caret line="34" column="77" selection-start-line="34" selection-start-column="77" selection-end-line="34" selection-end-column="77" />
767 798
           <folding>
768 799
             <element signature="imports" expanded="true" />
769 800
           </folding>
770 801
         </state>
771 802
       </provider>
772 803
     </entry>
773
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/model/Transactions.java">
804
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/controller/TransactionController.java">
774 805
       <provider selected="true" editor-type-id="text-editor">
775
-        <state relative-caret-position="579">
776
-          <caret line="77" column="5" lean-forward="true" selection-start-line="77" selection-start-column="5" selection-end-line="77" selection-end-column="5" />
806
+        <state relative-caret-position="430">
807
+          <caret line="47" column="58" lean-forward="true" selection-start-line="47" selection-start-column="58" selection-end-line="47" selection-end-column="58" />
777 808
           <folding>
778 809
             <element signature="imports" expanded="true" />
779 810
           </folding>

+ 1
- 1
src/main/java/com/buecoin01/ProcessLoader.java View File

@@ -28,7 +28,7 @@ public class ProcessLoader implements ApplicationRunner {
28 28
 
29 29
     @Override
30 30
     public void run(ApplicationArguments args) {
31
-        transaction.transferMoney(2L,1L,500);
31
+
32 32
 
33 33
     }
34 34
 }

+ 4
- 3
src/main/java/com/buecoin01/Repositories/TransactionRepository.java View File

@@ -1,14 +1,15 @@
1 1
 package com.buecoin01.Repositories;
2 2
 
3 3
 import com.buecoin01.model.Transactions;
4
+import com.buecoin01.model.Wallet;
4 5
 import org.springframework.data.jpa.repository.JpaRepository;
6
+import org.springframework.data.jpa.repository.Query;
5 7
 import org.springframework.stereotype.Repository;
6 8
 import org.springframework.web.bind.annotation.CrossOrigin;
7
-import org.springframework.web.bind.annotation.RequestBody;
8
-
9
-import javax.transaction.Transaction;
10 9
 
11 10
 @CrossOrigin(origins = {"http://localhost:8100","http://localhost:8080"})
12 11
 @Repository
13 12
 public interface TransactionRepository extends JpaRepository<Transactions, Long> {
13
+
14
+
14 15
 }

+ 9
- 0
src/main/java/com/buecoin01/Repositories/WalletRepository.java View File

@@ -2,10 +2,19 @@ package com.buecoin01.Repositories;
2 2
 
3 3
 import com.buecoin01.model.Wallet;
4 4
 import org.springframework.data.jpa.repository.JpaRepository;
5
+import org.springframework.data.jpa.repository.Query;
6
+import org.springframework.data.repository.query.Param;
5 7
 import org.springframework.stereotype.Repository;
6 8
 import org.springframework.web.bind.annotation.CrossOrigin;
7 9
 
10
+import java.util.List;
11
+
8 12
 @Repository
9 13
 @CrossOrigin(origins = {"http://localhost:8100","http://localhost:8080"})
10 14
 public interface WalletRepository extends JpaRepository<Wallet, Long> {
15
+
16
+    //@Query(value = "SELECT t FROM Wallet as t WHERE t.publicId = ?1", nativeQuery = true)
17
+    List<Wallet> findWalletByPublicId(@Param("id")String id);
18
+
19
+
11 20
 }

+ 3
- 6
src/main/java/com/buecoin01/controller/BlockController.java View File

@@ -9,12 +9,9 @@ import org.springframework.web.bind.annotation.*;
9 9
 
10 10
 import java.util.Optional;
11 11
 
12
-public class BlockController { @CrossOrigin(origins = {"http://localhost:8100", "http://localhost:8080"})
13 12
 @RestController
14
-
15
-
16
-public class UserController {
17
-
13
+@CrossOrigin(origins = {"http://localhost:8100", "http://localhost:8080"})
14
+public class BlockController {
18 15
 
19 16
     @Autowired
20 17
     private BlockRepository blockRepository;
@@ -53,4 +50,4 @@ public class UserController {
53 50
 
54 51
 
55 52
 }
56
-}
53
+

+ 40
- 22
src/main/java/com/buecoin01/controller/ConductTransactions.java View File

@@ -5,40 +5,58 @@ import com.buecoin01.Repositories.WalletRepository;
5 5
 import com.buecoin01.model.Transactions;
6 6
 import com.buecoin01.model.Wallet;
7 7
 import com.buecoin01.utility.Encryption;
8
+import org.slf4j.Logger;
9
+import org.slf4j.LoggerFactory;
8 10
 import org.springframework.beans.factory.annotation.Autowired;
9
-import org.springframework.web.bind.annotation.RestController;
11
+import org.springframework.http.HttpStatus;
12
+import org.springframework.http.ResponseEntity;
13
+import org.springframework.stereotype.Service;
10 14
 
11 15
 import java.time.LocalDateTime;
12 16
 
13
-@RestController
17
+@Service
14 18
 public class ConductTransactions {
19
+
20
+
15 21
     @Autowired
16 22
     private TransactionRepository transactionRepository;
17 23
 
18 24
     @Autowired
19 25
     private WalletRepository walletRepository;
20 26
 
27
+    private static final Logger logger = LoggerFactory.getLogger(ConductTransactions.class);
28
+
29
+
30
+    public ResponseEntity transferMoney( Transactions transaction) {
31
+       Wallet receiver = new Wallet();
32
+
33
+        Wallet sender = new Wallet();
34
+
35
+           if (walletRepository.findWalletByPublicId(transaction.getFromId()).get(0).getAmount() >= transaction.getAmount()) {
36
+
37
+        logger.info("controller is hitting this method");
38
+               sender.setAmount(walletRepository.findWalletByPublicId(transaction.getFromId()).get(0).getAmount() - transaction.getAmount());
39
+               walletRepository.save(sender);
21 40
 
22
-    public double getBalance(Long id){
23
-        return walletRepository.getOne(id).getAmount();
24
-    }
25
-
26
-    public String transferMoney(Long toId, Long fromId, double amount){
27
-        String response;
28
-        if(amount <= getBalance(fromId)){
29
-            Wallet from = walletRepository.getOne(toId);
30
-            from.setAmount(getBalance(fromId) - amount);
31
-            walletRepository.save(from);
32
-            Wallet to = walletRepository.getOne(fromId);
33
-            to.setAmount(getBalance(fromId) + amount);
34
-            walletRepository.save(to);
35
-            Transactions n = new Transactions(Encryption.applySha256(toId.toString() + fromId.toString() + Double.toString(amount)), Encryption.applySha256(fromId.toString()), Encryption.applySha256(toId.toString()), amount, LocalDateTime.now());
36
-            transactionRepository.save(n);
37
-            response = "Success";
38
-        } else response = "Insufficient funds";
39
-
40
-        return response;
41
-    }
41
+               Double amount = walletRepository.findWalletByPublicId(transaction.getToId()).get(0).getAmount();
42
+
43
+               receiver.setAmount(amount + transaction.getAmount());
44
+               walletRepository.save(receiver);
45
+
46
+               Transactions n = new Transactions(Encryption.applySha256(sender.getPublicId() + receiver.getPublicId() + Double.toString(transaction.getAmount()) + LocalDateTime.now()),
47
+                       sender.getPublicId(), receiver.getPublicId(), transaction.getAmount(), LocalDateTime.now());
48
+               logger.info("got here");
49
+
50
+               transactionRepository.save(n);
51
+               logger.info("got here");
52
+
53
+               return new ResponseEntity<>(transaction, HttpStatus.CREATED);
54
+           } else {
55
+               return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
56
+           }
57
+
58
+
59
+}
42 60
 
43 61
 
44 62
 

+ 11
- 7
src/main/java/com/buecoin01/controller/TransactionController.java View File

@@ -13,11 +13,14 @@ import java.util.Optional;
13 13
 @RestController
14 14
 public class TransactionController {
15 15
 
16
-
17
-
16
+        private ConductTransactions conduct;
17
+        private TransactionRepository transactionRepository;
18 18
 
19 19
         @Autowired
20
-        private TransactionRepository transactionRepository;
20
+        public TransactionController(TransactionRepository transactionRepository, ConductTransactions conductTransactions) {
21
+            this.conduct = conductTransactions;
22
+            this.transactionRepository = transactionRepository;
23
+        }
21 24
 
22 25
         @RequestMapping(value = "/transactions/{id}", method = RequestMethod.GET)
23 26
         public ResponseEntity get(@PathVariable Long id) {
@@ -33,13 +36,13 @@ public class TransactionController {
33 36
 
34 37
         }
35 38
 
36
-        @RequestMapping(path = "/addTx", method = RequestMethod.POST)
37
-        public ResponseEntity <?> create(@RequestBody Transactions transactions) {
38
-            transactionRepository.save(transactions);
39
+        @RequestMapping(path = "/checkTx", method = RequestMethod.POST)
40
+        public ResponseEntity <Transactions> create(@RequestBody Transactions transactions) {
41
+            conduct.transferMoney(transactions);
39 42
             return new ResponseEntity <>(transactions, HttpStatus.CREATED );
40 43
         }
41 44
 
42
-        @RequestMapping(path = "/deleteTx", method = RequestMethod.DELETE)
45
+        @RequestMapping(path = "/deleteTx/{id}", method = RequestMethod.DELETE)
43 46
         public ResponseEntity <Transactions> deleteUser(@RequestBody Transactions transactions) {
44 47
             transactionRepository.delete(transactions);
45 48
             return new ResponseEntity <>( HttpStatus.OK );
@@ -52,5 +55,6 @@ public class TransactionController {
52 55
         }
53 56
 
54 57
 
58
+
55 59
     }
56 60
 

+ 3
- 0
src/main/java/com/buecoin01/model/Block.java View File

@@ -2,6 +2,7 @@ package com.buecoin01.model;
2 2
 
3 3
 
4 4
 import com.buecoin01.utility.Encryption;
5
+import org.springframework.stereotype.Component;
5 6
 
6 7
 import javax.persistence.*;
7 8
 import java.time.LocalDateTime;
@@ -9,6 +10,7 @@ import java.util.ArrayList;
9 10
 
10 11
 
11 12
 @Entity
13
+@Component
12 14
 public class Block {
13 15
 
14 16
     private String minerID;
@@ -34,6 +36,7 @@ public class Block {
34 36
         this.timeStamp = time;
35 37
         this.previousHash = previousHash;
36 38
         this.hash = calculateHash();
39
+        this.nonce = nonce;
37 40
     }
38 41
 
39 42
     public String getHash() {

+ 2
- 10
src/main/java/com/buecoin01/model/Transactions.java View File

@@ -1,18 +1,9 @@
1 1
 package com.buecoin01.model;
2 2
 
3
-import com.buecoin01.utility.Encryption;
4
-import com.buecoin01.utility.TransactionInput;
5
-import com.buecoin01.utility.TransactionOutput;
6
-import org.springframework.beans.factory.annotation.Autowired;
7
-import org.springframework.context.annotation.Bean;
8 3
 import org.springframework.stereotype.Component;
9 4
 
10 5
 import javax.persistence.*;
11
-import java.security.PrivateKey;
12
-import java.security.PublicKey;
13 6
 import java.time.LocalDateTime;
14
-import java.util.ArrayList;
15
-import java.util.List;
16 7
 
17 8
 @Component
18 9
 @Entity
@@ -29,6 +20,8 @@ public class Transactions {
29 20
     private double amount;
30 21
     private LocalDateTime timestamp;
31 22
 
23
+    public Transactions(){}
24
+
32 25
     public Transactions(String transactionId, String fromId, String toId, double amount, LocalDateTime timestamp) {
33 26
         this.transactionId = transactionId;
34 27
         this.fromId = fromId;
@@ -85,7 +78,6 @@ public class Transactions {
85 78
         this.timestamp = timestamp;
86 79
     }
87 80
 
88
-    public Transactions(){}
89 81
 
90 82
 
91 83
 }

+ 2
- 7
src/main/java/com/buecoin01/model/Wallet.java View File

@@ -1,25 +1,20 @@
1 1
 package com.buecoin01.model;
2 2
 
3
-import com.buecoin01.utility.TransactionInput;
4
-import com.buecoin01.utility.TransactionOutput;
5
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
6
-import org.hibernate.annotations.Proxy;
7 3
 import org.springframework.stereotype.Component;
8 4
 
9 5
 import javax.persistence.*;
10
-import java.security.*;
11 6
 
12 7
 
13 8
 @Entity
14 9
 @Component
15
-@Proxy(lazy = false)
10
+//@Proxy(lazy = false)
16 11
 public class Wallet {
17 12
 
18 13
     @Id
19 14
     @Column(name = "id")
20 15
     @GeneratedValue(strategy = GenerationType.IDENTITY)
21 16
     private long id;
22
-    @Column(name = "pubicId")
17
+    @Column(name = "pubicId", unique = true)
23 18
     private String publicId;
24 19
     @Column(name = "amount")
25 20
     private double amount;

+ 1
- 2
src/main/resources/application.properties View File

@@ -7,5 +7,4 @@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver
7 7
 spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
8 8
 spring.datasource.testWhileIdle = true
9 9
 spring.datasource.validationQuery = SELECT 1
10
-
11
-
10
+#spring.jpa.hibernate.naming_strategy=org.hibernate.cfg.EJB3NamingStrategy

+ 1
- 2
target/classes/application.properties View File

@@ -7,5 +7,4 @@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver
7 7
 spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
8 8
 spring.datasource.testWhileIdle = true
9 9
 spring.datasource.validationQuery = SELECT 1
10
-
11
-
10
+#spring.jpa.hibernate.naming_strategy=org.hibernate.cfg.EJB3NamingStrategy

BIN
target/classes/com/buecoin01/ProcessLoader.class View File


BIN
target/classes/com/buecoin01/Repositories/WalletRepository.class View File


BIN
target/classes/com/buecoin01/controller/BlockController$UserController.class View File


BIN
target/classes/com/buecoin01/controller/BlockController.class View File


BIN
target/classes/com/buecoin01/controller/ConductTransactions.class View File


BIN
target/classes/com/buecoin01/controller/TransactionController.class View File


BIN
target/classes/com/buecoin01/model/Block.class View File


BIN
target/classes/com/buecoin01/model/Transactions.class View File


BIN
target/classes/com/buecoin01/model/Wallet.class View File