Khalil Malik Saboor před 6 roky
rodič
revize
28b953498a

binární
.DS_Store Zobrazit soubor


+ 36
- 15
.idea/workspace.xml Zobrazit soubor

@@ -95,9 +95,9 @@
95 95
       <foldersAlwaysOnTop value="true" />
96 96
     </navigator>
97 97
     <panes>
98
+      <pane id="Scope" />
98 99
       <pane id="PackagesPane" />
99 100
       <pane id="AndroidView" />
100
-      <pane id="Scope" />
101 101
       <pane id="ProjectPane">
102 102
         <subPane>
103 103
           <expand>
@@ -408,43 +408,64 @@
408 408
     </history-entry>
409 409
   </component>
410 410
   <component name="TimeTrackingManager">
411
-    <option name="totallyTimeSpent" value="14321000" />
411
+    <option name="totallyTimeSpent" value="14388000" />
412 412
   </component>
413 413
   <component name="ToolWindowManager">
414
-    <frame x="0" y="0" width="1280" height="800" extended-state="0" />
414
+    <frame x="0" y="22" width="1680" height="970" extended-state="6" />
415 415
     <layout>
416 416
       <window_info anchor="right" id="Palette" order="3" />
417 417
       <window_info anchor="bottom" id="TODO" order="6" />
418 418
       <window_info anchor="right" id="Palette&#9;" order="3" />
419 419
       <window_info id="Image Layers" order="2" />
420 420
       <window_info anchor="right" id="Capture Analysis" order="3" />
421
-      <window_info anchor="bottom" id="Event Log" order="7" side_tool="true" />
422
-      <window_info anchor="right" id="Maven Projects" order="3" />
421
+      <window_info anchor="bottom" id="Event Log" order="7" sideWeight="0.50076926" side_tool="true" weight="0.3298969" />
422
+      <window_info anchor="right" id="Maven Projects" order="3" visible="true" weight="0.1929182" />
423 423
       <window_info anchor="bottom" id="Database Changes" order="7" show_stripe_button="false" />
424
-      <window_info anchor="bottom" id="Run" order="2" weight="0.19586207" />
425 424
       <window_info anchor="bottom" id="Version Control" order="7" />
426
-      <window_info anchor="bottom" id="Terminal" order="7" weight="0.32954547" />
425
+      <window_info anchor="bottom" id="Run" order="2" weight="0.3298969" />
426
+      <window_info active="true" anchor="bottom" id="Terminal" order="7" sideWeight="0.49923077" visible="true" weight="0.3298969" />
427 427
       <window_info id="Capture Tool" order="2" />
428 428
       <window_info id="Designer" order="2" />
429
-      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.26494345" />
429
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.15506716" />
430 430
       <window_info anchor="right" id="Database" order="3" />
431 431
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
432 432
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
433 433
       <window_info id="UI Designer" order="2" />
434 434
       <window_info anchor="right" id="Theme Preview" order="3" />
435
+      <window_info id="Favorites" order="2" side_tool="true" />
435 436
       <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
437
+      <window_info anchor="bottom" id="Message" order="0" />
438
+      <window_info anchor="bottom" id="Event Log" order="7" side_tool="true" />
439
+      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.26494345" />
436 440
       <window_info id="Favorites" order="2" side_tool="true" />
437
-      <window_info id="Web" order="4" side_tool="true" />
441
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
442
+      <window_info anchor="bottom" id="Java Enterprise" order="10" />
443
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
444
+      <window_info anchor="bottom" id="Terminal" order="7" weight="0.32954547" />
445
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
446
+      <window_info anchor="right" id="Palette" order="3" />
447
+      <window_info anchor="right" id="Palette&#9;" order="3" />
448
+      <window_info anchor="right" id="Maven Projects" order="3" />
449
+      <window_info id="Web" order="3" side_tool="true" />
450
+      <window_info anchor="bottom" id="Database Changes" order="7" show_stripe_button="false" />
438 451
       <window_info anchor="bottom" id="Spring" order="9" />
452
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
453
+      <window_info id="Image Layers" order="2" />
454
+      <window_info anchor="right" id="Theme Preview" order="3" />
455
+      <window_info anchor="right" id="Database" order="3" />
456
+      <window_info id="Capture Tool" order="2" />
457
+      <window_info anchor="bottom" id="Version Control" order="7" />
458
+      <window_info anchor="right" id="Capture Analysis" order="3" />
459
+      <window_info anchor="bottom" id="TODO" order="6" />
460
+      <window_info anchor="bottom" id="Find" order="1" weight="0.32954547" />
439 461
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
440
-      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
441 462
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
442
-      <window_info anchor="bottom" id="Messages" order="9" weight="0.3298969" />
443
-      <window_info anchor="bottom" id="Message" order="0" />
463
+      <window_info id="UI Designer" order="2" />
444 464
       <window_info anchor="right" id="Bean Validation" order="4" />
445
-      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
446
-      <window_info anchor="bottom" id="Java Enterprise" order="8" />
447
-      <window_info anchor="bottom" id="Find" order="1" weight="0.32954547" />
465
+      <window_info anchor="bottom" id="Run" order="2" weight="0.19586207" />
466
+      <window_info anchor="bottom" id="Messages" order="9" weight="0.3298969" />
467
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
468
+      <window_info id="Designer" order="2" />
448 469
     </layout>
449 470
   </component>
450 471
   <component name="TypeScriptGeneratedFilesManager">

+ 1
- 1
ZipCoinRedIonicClient/.sourcemaps/main.js.map
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 1
- 2
ZipCoinRedIonicClient/www/build/main.js Zobrazit soubor

@@ -72,10 +72,9 @@ var HomePage = /** @class */ (function () {
72 72
         Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
73 73
             selector: 'page-home',template:/*ion-inline-start:"/Users/ericf/ZCWProjects/ZipCoin-RED/ZipCoinRedIonicClient/src/pages/home/home.html"*/'<ion-header>\n  <ion-navbar>\n    <ion-title>\n      ZipCoin BlockChain\n    </ion-title>\n  </ion-navbar>\n</ion-header>\n\n<ion-content padding>\n  \n  <div class="well well-success col-xs-7" id="blockchain">\n       <div class="list list-inset">\n          <label class="item item-input"> Block #:<input type="text" disabled placeholder= "{{ block.blockNumber }}" ></label>\n          <label class="item item-input"> Nonce:<input type="text" disabled placeholder= "{{ block.nonce }}" ></label>\n          <label class="item item-input"> Data:<input type="text" disabled placeholder= "{{ block.transactionList }}" > </label>\n          <label class="item item-input"> Hash:<input type="text" disabled placeholder= "{{ block.currentHash }}" ></label>\n    <!-- <label class="item item-input"> HashPrev: <input type="text" disabled placeholder="Hash"></label> -->\n          <button ion-button>Mine</button>\n        </div>\n  </div>   \n\n</ion-content>'/*ion-inline-end:"/Users/ericf/ZCWProjects/ZipCoin-RED/ZipCoinRedIonicClient/src/pages/home/home.html"*/
74 74
         }),
75
-        __metadata("design:paramtypes", [typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["d" /* NavController */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["d" /* NavController */]) === "function" && _a || Object, typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_2__providers_block_service__["a" /* BlockService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__providers_block_service__["a" /* BlockService */]) === "function" && _b || Object])
75
+        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["d" /* NavController */], __WEBPACK_IMPORTED_MODULE_2__providers_block_service__["a" /* BlockService */]])
76 76
     ], HomePage);
77 77
     return HomePage;
78
-    var _a, _b;
79 78
 }());
80 79
 
81 80
 //# sourceMappingURL=home.js.map

+ 1
- 1
ZipCoinRedIonicClient/www/build/main.js.map
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 1
- 1
ZipCoinRedIonicClient/www/build/vendor.js.map
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 250
- 35
ZipCoinRedJavaServer/.idea/workspace.xml Zobrazit soubor

@@ -29,8 +29,13 @@
29 29
       <file leaf-file-name="Block.java" pinned="false" current-in-tab="true">
30 30
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/model/Block.java">
31 31
           <provider selected="true" editor-type-id="text-editor">
32
+<<<<<<< HEAD
32 33
             <state relative-caret-position="209">
33 34
               <caret line="15" column="31" lean-forward="true" selection-start-line="15" selection-start-column="31" selection-end-line="15" selection-end-column="31" />
35
+=======
36
+            <state relative-caret-position="900">
37
+              <caret line="82" column="4" selection-start-line="82" selection-start-column="4" selection-end-line="82" selection-end-column="4" />
38
+>>>>>>> a3e38f019b5aa826216e72693185d91438d8fb7d
34 39
               <folding>
35 40
                 <element signature="imports" expanded="true" />
36 41
               </folding>
@@ -41,7 +46,11 @@
41 46
       <file leaf-file-name="BlockController.java" pinned="false" current-in-tab="false">
42 47
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/controller/BlockController.java">
43 48
           <provider selected="true" editor-type-id="text-editor">
49
+<<<<<<< HEAD
44 50
             <state relative-caret-position="529">
51
+=======
52
+            <state relative-caret-position="74">
53
+>>>>>>> a3e38f019b5aa826216e72693185d91438d8fb7d
45 54
               <caret line="27" column="5" selection-start-line="27" selection-start-column="5" selection-end-line="27" selection-end-column="5" />
46 55
               <folding>
47 56
                 <element signature="imports" expanded="true" />
@@ -50,62 +59,123 @@
50 59
           </provider>
51 60
         </entry>
52 61
       </file>
53
-      <file leaf-file-name="HomeController.java" pinned="false" current-in-tab="false">
54
-        <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/controller/HomeController.java">
62
+      <file leaf-file-name="StringUtil.java" pinned="false" current-in-tab="false">
63
+        <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/Wallet/StringUtil.java">
55 64
           <provider selected="true" editor-type-id="text-editor">
65
+<<<<<<< HEAD
56 66
             <state relative-caret-position="138">
57 67
               <caret line="9" column="5" selection-start-line="9" selection-start-column="5" selection-end-line="9" selection-end-column="5" />
68
+=======
69
+            <state relative-caret-position="540">
70
+              <caret line="36" column="1" selection-start-line="36" selection-start-column="1" selection-end-line="36" selection-end-column="1" />
71
+              <folding>
72
+                <element signature="e#1167#1168#0" expanded="true" />
73
+                <element signature="e#1206#1207#0" expanded="true" />
74
+              </folding>
75
+>>>>>>> a3e38f019b5aa826216e72693185d91438d8fb7d
58 76
             </state>
59 77
           </provider>
60 78
         </entry>
61 79
       </file>
62
-      <file leaf-file-name="application.properties" pinned="false" current-in-tab="false">
63
-        <entry file="file://$PROJECT_DIR$/src/main/resources/application.properties">
80
+      <file leaf-file-name="Transaction.java" pinned="false" current-in-tab="false">
81
+        <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/Wallet/Transaction.java">
64 82
           <provider selected="true" editor-type-id="text-editor">
83
+<<<<<<< HEAD
65 84
             <state relative-caret-position="253">
66 85
               <caret line="11" lean-forward="true" selection-start-line="11" selection-end-line="11" />
86
+=======
87
+            <state relative-caret-position="225">
88
+              <caret line="15" column="29" lean-forward="true" selection-start-line="15" selection-start-column="29" selection-end-line="15" selection-end-column="29" />
89
+              <folding>
90
+                <element signature="imports" expanded="true" />
91
+                <element signature="e#534#535#0" expanded="true" />
92
+                <element signature="e#570#571#0" expanded="true" />
93
+                <element signature="e#628#629#0" expanded="true" />
94
+                <element signature="e#678#679#0" expanded="true" />
95
+                <element signature="e#714#715#0" expanded="true" />
96
+                <element signature="e#743#744#0" expanded="true" />
97
+                <element signature="e#790#791#0" expanded="true" />
98
+                <element signature="e#826#827#0" expanded="true" />
99
+                <element signature="e#866#867#0" expanded="true" />
100
+                <element signature="e#899#900#0" expanded="true" />
101
+                <element signature="e#954#955#0" expanded="true" />
102
+                <element signature="e#998#999#0" expanded="true" />
103
+                <element signature="e#1029#1030#0" expanded="true" />
104
+                <element signature="e#1057#1058#0" expanded="true" />
105
+                <element signature="e#1098#1099#0" expanded="true" />
106
+                <element signature="e#1132#1133#0" expanded="true" />
107
+              </folding>
108
+>>>>>>> a3e38f019b5aa826216e72693185d91438d8fb7d
67 109
             </state>
68 110
           </provider>
69 111
         </entry>
70 112
       </file>
71
-      <file leaf-file-name="pom.xml" pinned="false" current-in-tab="false">
72
-        <entry file="file://$PROJECT_DIR$/pom.xml">
113
+      <file leaf-file-name="Wallet.java" pinned="false" current-in-tab="false">
114
+        <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/Wallet/Wallet.java">
73 115
           <provider selected="true" editor-type-id="text-editor">
116
+<<<<<<< HEAD
74 117
             <state relative-caret-position="897">
75 118
               <caret line="39" column="21" selection-start-line="39" selection-start-column="21" selection-end-line="39" selection-end-column="21" />
119
+=======
120
+            <state relative-caret-position="234">
121
+              <caret line="23" lean-forward="true" selection-start-line="23" selection-end-line="23" />
122
+              <folding>
123
+                <element signature="e#159#160#0" expanded="true" />
124
+                <element signature="e#192#193#0" expanded="true" />
125
+                <element signature="e#232#233#0" expanded="true" />
126
+                <element signature="e#264#265#0" expanded="true" />
127
+                <element signature="e#290#291#0" expanded="true" />
128
+                <element signature="e#323#324#0" expanded="true" />
129
+              </folding>
130
+>>>>>>> a3e38f019b5aa826216e72693185d91438d8fb7d
76 131
             </state>
77 132
           </provider>
78 133
         </entry>
79 134
       </file>
80
-      <file leaf-file-name="BlockRepository.java" pinned="false" current-in-tab="false">
81
-        <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/repository/BlockRepository.java">
135
+      <file leaf-file-name="TransactionAndWalletTest.java" pinned="false" current-in-tab="true">
136
+        <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcoin/redCoin/TransactionAndWallet/TransactionAndWalletTest.java">
82 137
           <provider selected="true" editor-type-id="text-editor">
138
+<<<<<<< HEAD
83 139
             <state relative-caret-position="115">
84 140
               <caret line="5" column="17" selection-start-line="5" selection-start-column="17" selection-end-line="5" selection-end-column="17" />
141
+=======
142
+            <state relative-caret-position="105">
143
+              <caret line="7" column="41" lean-forward="true" selection-start-line="7" selection-start-column="41" selection-end-line="7" selection-end-column="41" />
144
+>>>>>>> a3e38f019b5aa826216e72693185d91438d8fb7d
85 145
               <folding>
86
-                <element signature="imports" expanded="true" />
146
+                <element signature="e#432#439#0" expanded="true" />
87 147
               </folding>
88 148
             </state>
89 149
           </provider>
90 150
         </entry>
91 151
       </file>
92
-      <file leaf-file-name="ZipCoinApp.java" pinned="false" current-in-tab="false">
93
-        <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/ZipCoinApp.java">
152
+      <file leaf-file-name="application.properties" pinned="false" current-in-tab="false">
153
+        <entry file="file://$PROJECT_DIR$/src/main/resources/application.properties">
94 154
           <provider selected="true" editor-type-id="text-editor">
155
+<<<<<<< HEAD
95 156
             <state relative-caret-position="138">
96 157
               <caret line="6" column="13" selection-start-line="6" selection-start-column="13" selection-end-line="6" selection-end-column="13" />
97 158
               <folding>
98 159
                 <element signature="imports" expanded="true" />
99 160
               </folding>
161
+=======
162
+            <state relative-caret-position="330">
163
+              <caret line="22" column="44" selection-start-line="22" selection-start-column="44" selection-end-line="22" selection-end-column="44" />
164
+>>>>>>> a3e38f019b5aa826216e72693185d91438d8fb7d
100 165
             </state>
101 166
           </provider>
102 167
         </entry>
103 168
       </file>
104
-      <file leaf-file-name="V2__create_block.sql" pinned="false" current-in-tab="false">
105
-        <entry file="file://$PROJECT_DIR$/src/main/resources/db/migration/V2__create_block.sql">
169
+      <file leaf-file-name="pom.xml" pinned="false" current-in-tab="false">
170
+        <entry file="file://$PROJECT_DIR$/pom.xml">
106 171
           <provider selected="true" editor-type-id="text-editor">
172
+<<<<<<< HEAD
107 173
             <state relative-caret-position="161">
108 174
               <caret line="7" column="2" selection-start-line="7" selection-start-column="2" selection-end-line="7" selection-end-column="2" />
175
+=======
176
+            <state relative-caret-position="585">
177
+              <caret line="39" column="21" selection-start-line="39" selection-start-column="21" selection-end-line="39" selection-end-column="21" />
178
+>>>>>>> a3e38f019b5aa826216e72693185d91438d8fb7d
109 179
             </state>
110 180
           </provider>
111 181
         </entry>
@@ -162,6 +232,10 @@
162 232
         <option value="$PROJECT_DIR$/src/main/java/com/zipcoin/model/Miner.java" />
163 233
         <option value="$PROJECT_DIR$/src/test/java/redCoin/Miner/minerTest.java" />
164 234
         <option value="$PROJECT_DIR$/src/main/java/com/zipcoin/controller/BlockController.java" />
235
+        <option value="$PROJECT_DIR$/src/main/java/com/zipcoin/Wallet/StringUtil.java" />
236
+        <option value="$PROJECT_DIR$/src/main/java/com/zipcoin/Wallet/Transaction.java" />
237
+        <option value="$PROJECT_DIR$/src/main/java/com/zipcoin/Wallet/Wallet.java" />
238
+        <option value="$PROJECT_DIR$/src/test/java/com/zipcoin/redCoin/TransactionAndWallet/TransactionAndWalletTest.java" />
165 239
       </list>
166 240
     </option>
167 241
   </component>
@@ -187,11 +261,11 @@
187 261
   <component name="NodePackageJsonFileManager">
188 262
     <packageJsonPaths />
189 263
   </component>
190
-  <component name="ProjectFrameBounds" fullScreen="true">
191
-    <option name="x" value="67" />
192
-    <option name="y" value="36" />
193
-    <option name="width" value="1043" />
194
-    <option name="height" value="699" />
264
+  <component name="ProjectFrameBounds">
265
+    <option name="x" value="39" />
266
+    <option name="y" value="23" />
267
+    <option name="width" value="1203" />
268
+    <option name="height" value="713" />
195 269
   </component>
196 270
   <component name="ProjectLevelVcsManager">
197 271
     <ConfirmationsSetting value="2" id="Add" />
@@ -236,7 +310,7 @@
236 310
               <item name="src" type="462c0819:PsiDirectoryNode" />
237 311
               <item name="main" type="462c0819:PsiDirectoryNode" />
238 312
               <item name="java" type="462c0819:PsiDirectoryNode" />
239
-              <item name="zipcoin" type="462c0819:PsiDirectoryNode" />
313
+              <item name="com" type="462c0819:PsiDirectoryNode" />
240 314
             </path>
241 315
             <path>
242 316
               <item name="ZipCoinRedJavaServer" type="b2602c69:ProjectViewProjectNode" />
@@ -244,8 +318,8 @@
244 318
               <item name="src" type="462c0819:PsiDirectoryNode" />
245 319
               <item name="main" type="462c0819:PsiDirectoryNode" />
246 320
               <item name="java" type="462c0819:PsiDirectoryNode" />
321
+              <item name="com" type="462c0819:PsiDirectoryNode" />
247 322
               <item name="zipcoin" type="462c0819:PsiDirectoryNode" />
248
-              <item name="controller" type="462c0819:PsiDirectoryNode" />
249 323
             </path>
250 324
             <path>
251 325
               <item name="ZipCoinRedJavaServer" type="b2602c69:ProjectViewProjectNode" />
@@ -253,8 +327,9 @@
253 327
               <item name="src" type="462c0819:PsiDirectoryNode" />
254 328
               <item name="main" type="462c0819:PsiDirectoryNode" />
255 329
               <item name="java" type="462c0819:PsiDirectoryNode" />
330
+              <item name="com" type="462c0819:PsiDirectoryNode" />
256 331
               <item name="zipcoin" type="462c0819:PsiDirectoryNode" />
257
-              <item name="model" type="462c0819:PsiDirectoryNode" />
332
+              <item name="Wallet" type="462c0819:PsiDirectoryNode" />
258 333
             </path>
259 334
             <path>
260 335
               <item name="ZipCoinRedJavaServer" type="b2602c69:ProjectViewProjectNode" />
@@ -263,10 +338,67 @@
263 338
               <item name="main" type="462c0819:PsiDirectoryNode" />
264 339
               <item name="resources" type="462c0819:PsiDirectoryNode" />
265 340
             </path>
341
+            <path>
342
+              <item name="ZipCoinRedJavaServer" type="b2602c69:ProjectViewProjectNode" />
343
+              <item name="ZipCoinRedJavaServer" type="462c0819:PsiDirectoryNode" />
344
+              <item name="src" type="462c0819:PsiDirectoryNode" />
345
+              <item name="test" type="462c0819:PsiDirectoryNode" />
346
+            </path>
347
+            <path>
348
+              <item name="ZipCoinRedJavaServer" type="b2602c69:ProjectViewProjectNode" />
349
+              <item name="ZipCoinRedJavaServer" type="462c0819:PsiDirectoryNode" />
350
+              <item name="src" type="462c0819:PsiDirectoryNode" />
351
+              <item name="test" type="462c0819:PsiDirectoryNode" />
352
+              <item name="java" type="462c0819:PsiDirectoryNode" />
353
+            </path>
354
+            <path>
355
+              <item name="ZipCoinRedJavaServer" type="b2602c69:ProjectViewProjectNode" />
356
+              <item name="ZipCoinRedJavaServer" type="462c0819:PsiDirectoryNode" />
357
+              <item name="src" type="462c0819:PsiDirectoryNode" />
358
+              <item name="test" type="462c0819:PsiDirectoryNode" />
359
+              <item name="java" type="462c0819:PsiDirectoryNode" />
360
+              <item name="com" type="462c0819:PsiDirectoryNode" />
361
+            </path>
362
+            <path>
363
+              <item name="ZipCoinRedJavaServer" type="b2602c69:ProjectViewProjectNode" />
364
+              <item name="ZipCoinRedJavaServer" type="462c0819:PsiDirectoryNode" />
365
+              <item name="src" type="462c0819:PsiDirectoryNode" />
366
+              <item name="test" type="462c0819:PsiDirectoryNode" />
367
+              <item name="java" type="462c0819:PsiDirectoryNode" />
368
+              <item name="com" type="462c0819:PsiDirectoryNode" />
369
+              <item name="zipcoin" type="462c0819:PsiDirectoryNode" />
370
+            </path>
371
+            <path>
372
+              <item name="ZipCoinRedJavaServer" type="b2602c69:ProjectViewProjectNode" />
373
+              <item name="ZipCoinRedJavaServer" type="462c0819:PsiDirectoryNode" />
374
+              <item name="src" type="462c0819:PsiDirectoryNode" />
375
+              <item name="test" type="462c0819:PsiDirectoryNode" />
376
+              <item name="java" type="462c0819:PsiDirectoryNode" />
377
+              <item name="com" type="462c0819:PsiDirectoryNode" />
378
+              <item name="zipcoin" type="462c0819:PsiDirectoryNode" />
379
+              <item name="redCoin" type="462c0819:PsiDirectoryNode" />
380
+            </path>
381
+            <path>
382
+              <item name="ZipCoinRedJavaServer" type="b2602c69:ProjectViewProjectNode" />
383
+              <item name="ZipCoinRedJavaServer" type="462c0819:PsiDirectoryNode" />
384
+              <item name="src" type="462c0819:PsiDirectoryNode" />
385
+              <item name="test" type="462c0819:PsiDirectoryNode" />
386
+              <item name="java" type="462c0819:PsiDirectoryNode" />
387
+              <item name="com" type="462c0819:PsiDirectoryNode" />
388
+              <item name="zipcoin" type="462c0819:PsiDirectoryNode" />
389
+              <item name="redCoin" type="462c0819:PsiDirectoryNode" />
390
+              <item name="TransactionAndWallet" type="462c0819:PsiDirectoryNode" />
391
+            </path>
266 392
           </expand>
267 393
           <select />
268 394
         </subPane>
269 395
       </pane>
396
+<<<<<<< HEAD
397
+=======
398
+      <pane id="AndroidView" />
399
+      <pane id="PackagesPane" />
400
+      <pane id="Scope" />
401
+>>>>>>> a3e38f019b5aa826216e72693185d91438d8fb7d
270 402
     </panes>
271 403
   </component>
272 404
   <component name="PropertiesComponent">
@@ -279,7 +411,7 @@
279 411
     <property name="WebServerToolWindowFactoryState" value="false" />
280 412
     <property name="aspect.path.notification.shown" value="true" />
281 413
     <property name="jdk.selected.JAVA_MODULE" value="1.8" />
282
-    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
414
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/pom.xml" />
283 415
     <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
284 416
     <property name="nodejs_npm_path_reset_for_default_project" value="true" />
285 417
     <property name="project.structure.last.edited" value="Modules" />
@@ -452,9 +584,15 @@
452 584
       <workItem from="1531419813805" duration="2054000" />
453 585
       <workItem from="1531772346214" duration="3133000" />
454 586
       <workItem from="1531775595883" duration="5563000" />
587
+<<<<<<< HEAD
455 588
       <workItem from="1531837698674" duration="1652000" />
456 589
       <workItem from="1531919430062" duration="82000" />
457 590
       <workItem from="1531919540581" duration="3064000" />
591
+=======
592
+      <workItem from="1531837698674" duration="1689000" />
593
+      <workItem from="1531920139324" duration="959000" />
594
+      <workItem from="1532352296647" duration="277000" />
595
+>>>>>>> a3e38f019b5aa826216e72693185d91438d8fb7d
458 596
     </task>
459 597
     <servers />
460 598
   </component>
@@ -488,11 +626,14 @@
488 626
     </history-entry>
489 627
   </component>
490 628
   <component name="TimeTrackingManager">
629
+<<<<<<< HEAD
491 630
     <option name="totallyTimeSpent" value="19058000" />
631
+=======
632
+    <option name="totallyTimeSpent" value="17185000" />
633
+>>>>>>> a3e38f019b5aa826216e72693185d91438d8fb7d
492 634
   </component>
493 635
   <component name="ToolWindowManager">
494
-    <frame x="0" y="0" width="1280" height="800" extended-state="0" />
495
-    <editor active="true" />
636
+    <frame x="39" y="23" width="1203" height="713" extended-state="0" />
496 637
     <layout>
497 638
       <window_info anchor="right" id="Palette" order="3" />
498 639
       <window_info anchor="bottom" id="Event Log" order="7" sideWeight="0.50080776" side_tool="true" visible="true" weight="0.36689654" />
@@ -506,16 +647,23 @@
506 647
       <window_info id="UI Designer" order="2" />
507 648
       <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
508 649
       <window_info anchor="bottom" id="TODO" order="6" />
509
-      <window_info anchor="bottom" id="Messages" order="9" weight="0.3298969" />
510 650
       <window_info anchor="right" id="Palette&#9;" order="3" />
511 651
       <window_info id="Image Layers" order="2" />
512 652
       <window_info anchor="bottom" id="Java Enterprise" order="8" />
513 653
       <window_info anchor="right" id="Capture Analysis" order="3" />
654
+<<<<<<< HEAD
514 655
       <window_info anchor="bottom" id="Run" order="2" sideWeight="0.49919224" weight="0.36689654" />
515 656
       <window_info anchor="bottom" id="Version Control" order="7" />
516 657
       <window_info anchor="bottom" id="Spring" order="9" />
517 658
       <window_info anchor="bottom" id="Terminal" order="7" weight="0.32954547" />
518 659
       <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.21405493" />
660
+=======
661
+      <window_info anchor="bottom" id="Run" order="2" weight="0.4318182" />
662
+      <window_info anchor="bottom" id="Version Control" order="7" />
663
+      <window_info anchor="bottom" id="Spring" order="9" />
664
+      <window_info active="true" anchor="bottom" id="Terminal" order="7" visible="true" weight="0.32954547" />
665
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.2868217" />
666
+>>>>>>> a3e38f019b5aa826216e72693185d91438d8fb7d
519 667
       <window_info anchor="right" id="Bean Validation" order="4" />
520 668
       <window_info id="Web" order="4" side_tool="true" />
521 669
       <window_info id="Learn" order="5" />
@@ -524,6 +672,7 @@
524 672
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
525 673
       <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
526 674
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
675
+      <window_info anchor="bottom" id="Messages" order="9" weight="0.3298969" />
527 676
       <window_info anchor="bottom" id="Message" order="0" />
528 677
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
529 678
       <window_info anchor="bottom" id="Find" order="1" weight="0.32954547" />
@@ -536,16 +685,6 @@
536 685
     <option name="myLimit" value="2678400000" />
537 686
   </component>
538 687
   <component name="editorHistoryManager">
539
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/redCoin/Main.java" />
540
-    <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcoin/redCoin/testMain.java" />
541
-    <entry file="file://$PROJECT_DIR$/pom.xml">
542
-      <provider selected="true" editor-type-id="text-editor">
543
-        <state relative-caret-position="165">
544
-          <caret line="11" column="10" lean-forward="true" selection-start-line="11" selection-start-column="10" selection-end-line="11" selection-end-column="10" />
545
-        </state>
546
-      </provider>
547
-    </entry>
548
-    <entry file="file://$PROJECT_DIR$/src/test/java/redCoin/minerTest.java" />
549 688
     <entry file="file://$PROJECT_DIR$/.idea/workspace.xml">
550 689
       <provider selected="true" editor-type-id="text-editor">
551 690
         <state relative-caret-position="405">
@@ -650,7 +789,11 @@
650 789
     </entry>
651 790
     <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/controller/HomeController.java">
652 791
       <provider selected="true" editor-type-id="text-editor">
792
+<<<<<<< HEAD
653 793
         <state relative-caret-position="138">
794
+=======
795
+        <state relative-caret-position="90">
796
+>>>>>>> a3e38f019b5aa826216e72693185d91438d8fb7d
654 797
           <caret line="9" column="5" selection-start-line="9" selection-start-column="5" selection-end-line="9" selection-end-column="5" />
655 798
         </state>
656 799
       </provider>
@@ -702,6 +845,7 @@
702 845
     </entry>
703 846
     <entry file="file://$PROJECT_DIR$/src/main/resources/application.properties">
704 847
       <provider selected="true" editor-type-id="text-editor">
848
+<<<<<<< HEAD
705 849
         <state relative-caret-position="253">
706 850
           <caret line="11" lean-forward="true" selection-start-line="11" selection-end-line="11" />
707 851
         </state>
@@ -711,6 +855,10 @@
711 855
       <provider selected="true" editor-type-id="text-editor">
712 856
         <state relative-caret-position="529">
713 857
           <caret line="27" column="5" selection-start-line="27" selection-start-column="5" selection-end-line="27" selection-end-column="5" />
858
+=======
859
+        <state relative-caret-position="900">
860
+          <caret line="82" column="4" selection-start-line="82" selection-start-column="4" selection-end-line="82" selection-end-column="4" />
861
+>>>>>>> a3e38f019b5aa826216e72693185d91438d8fb7d
714 862
           <folding>
715 863
             <element signature="imports" expanded="true" />
716 864
           </folding>
@@ -726,14 +874,81 @@
726 874
     </entry>
727 875
     <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/model/Block.java">
728 876
       <provider selected="true" editor-type-id="text-editor">
877
+<<<<<<< HEAD
729 878
         <state relative-caret-position="209">
730 879
           <caret line="15" column="31" lean-forward="true" selection-start-line="15" selection-start-column="31" selection-end-line="15" selection-end-column="31" />
880
+=======
881
+        <state relative-caret-position="74">
882
+          <caret line="27" column="5" selection-start-line="27" selection-start-column="5" selection-end-line="27" selection-end-column="5" />
731 883
           <folding>
732 884
             <element signature="imports" expanded="true" />
733 885
           </folding>
734 886
         </state>
735 887
       </provider>
736 888
     </entry>
889
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/Wallet/StringUtil.java">
890
+      <provider selected="true" editor-type-id="text-editor">
891
+        <state relative-caret-position="540">
892
+          <caret line="36" column="1" selection-start-line="36" selection-start-column="1" selection-end-line="36" selection-end-column="1" />
893
+          <folding>
894
+            <element signature="e#1167#1168#0" expanded="true" />
895
+            <element signature="e#1206#1207#0" expanded="true" />
896
+          </folding>
897
+        </state>
898
+      </provider>
899
+    </entry>
900
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/Wallet/Transaction.java">
901
+      <provider selected="true" editor-type-id="text-editor">
902
+        <state relative-caret-position="225">
903
+          <caret line="15" column="29" lean-forward="true" selection-start-line="15" selection-start-column="29" selection-end-line="15" selection-end-column="29" />
904
+>>>>>>> a3e38f019b5aa826216e72693185d91438d8fb7d
905
+          <folding>
906
+            <element signature="imports" expanded="true" />
907
+            <element signature="e#534#535#0" expanded="true" />
908
+            <element signature="e#570#571#0" expanded="true" />
909
+            <element signature="e#628#629#0" expanded="true" />
910
+            <element signature="e#678#679#0" expanded="true" />
911
+            <element signature="e#714#715#0" expanded="true" />
912
+            <element signature="e#743#744#0" expanded="true" />
913
+            <element signature="e#790#791#0" expanded="true" />
914
+            <element signature="e#826#827#0" expanded="true" />
915
+            <element signature="e#866#867#0" expanded="true" />
916
+            <element signature="e#899#900#0" expanded="true" />
917
+            <element signature="e#954#955#0" expanded="true" />
918
+            <element signature="e#998#999#0" expanded="true" />
919
+            <element signature="e#1029#1030#0" expanded="true" />
920
+            <element signature="e#1057#1058#0" expanded="true" />
921
+            <element signature="e#1098#1099#0" expanded="true" />
922
+            <element signature="e#1132#1133#0" expanded="true" />
923
+          </folding>
924
+        </state>
925
+      </provider>
926
+    </entry>
927
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcoin/Wallet/Wallet.java">
928
+      <provider selected="true" editor-type-id="text-editor">
929
+        <state relative-caret-position="234">
930
+          <caret line="23" lean-forward="true" selection-start-line="23" selection-end-line="23" />
931
+          <folding>
932
+            <element signature="e#159#160#0" expanded="true" />
933
+            <element signature="e#192#193#0" expanded="true" />
934
+            <element signature="e#232#233#0" expanded="true" />
935
+            <element signature="e#264#265#0" expanded="true" />
936
+            <element signature="e#290#291#0" expanded="true" />
937
+            <element signature="e#323#324#0" expanded="true" />
938
+          </folding>
939
+        </state>
940
+      </provider>
941
+    </entry>
942
+    <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcoin/redCoin/TransactionAndWallet/TransactionAndWalletTest.java">
943
+      <provider selected="true" editor-type-id="text-editor">
944
+        <state relative-caret-position="105">
945
+          <caret line="7" column="41" lean-forward="true" selection-start-line="7" selection-start-column="41" selection-end-line="7" selection-end-column="41" />
946
+          <folding>
947
+            <element signature="e#432#439#0" expanded="true" />
948
+          </folding>
949
+        </state>
950
+      </provider>
951
+    </entry>
737 952
   </component>
738 953
   <component name="masterDetails">
739 954
     <states>

+ 37
- 0
ZipCoinRedJavaServer/src/main/java/com/zipcoin/Wallet/StringUtil.java Zobrazit soubor

@@ -0,0 +1,37 @@
1
+package com.zipcoin.Wallet;
2
+
3
+import java.security.*;
4
+
5
+public class StringUtil {
6
+
7
+    public static Signature applyECDSASig(PrivateKey privateKey, String input) throws  NoSuchAlgorithmException, InvalidKeyException {
8
+
9
+        Signature signature=Signature.getInstance("DSA");
10
+        signature.initSign(privateKey);
11
+
12
+        return signature;
13
+    }
14
+
15
+    //Verifies a String signature
16
+    public static boolean verifyECDSASig(PublicKey publicKey, String data, byte[] signature) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException {
17
+        try {
18
+            Signature ecdsaVerify = Signature.getInstance("sha256withrsa");
19
+            ecdsaVerify.initVerify(publicKey);
20
+            ecdsaVerify.update(data.getBytes());
21
+            return ecdsaVerify.verify(signature);
22
+        }catch(Exception e) {
23
+            //e.printStackTrace();
24
+            throw new RuntimeException(e);
25
+
26
+        }
27
+        /*Signature signature1=Signature.getInstance("DSA");
28
+        signature1.initVerify(publicKey);
29
+        signature1.update(data.getBytes());
30
+        return signature1.verify(signature);*/
31
+    }
32
+
33
+
34
+    public static String getStringFromKey(PublicKey input) {
35
+        return input.toString();
36
+    }
37
+}

+ 78
- 0
ZipCoinRedJavaServer/src/main/java/com/zipcoin/Wallet/Transaction.java Zobrazit soubor

@@ -0,0 +1,78 @@
1
+package com.zipcoin.Wallet;
2
+
3
+import org.apache.commons.codec.digest.DigestUtils;
4
+
5
+import java.security.*;
6
+import java.util.ArrayList;
7
+
8
+public class Transaction {
9
+    private String transactionId; // this is also the hash of the transaction.
10
+    private PublicKey sender; // senders address/public key.
11
+    private PublicKey reciepient; // Recipients address/public key.
12
+    private float value;
13
+    public Signature signature;// this is to prevent anybody else from spending funds in our wallet.
14
+
15
+    public String getTransactionId() {
16
+        return transactionId;
17
+    }
18
+
19
+    public void setTransactionId(String transactionId) {
20
+        this.transactionId = transactionId;
21
+    }
22
+
23
+    public PublicKey getSender() {
24
+        return sender;
25
+    }
26
+
27
+    public void setSender(PublicKey sender) {
28
+        this.sender = sender;
29
+    }
30
+
31
+    public PublicKey getReciepient() {
32
+        return reciepient;
33
+    }
34
+
35
+    public void setReciepient(PublicKey reciepient) {
36
+        this.reciepient = reciepient;
37
+    }
38
+
39
+    public float getValue() {
40
+        return value;
41
+    }
42
+
43
+    public void setValue(float value) {
44
+        this.value = value;
45
+    }
46
+
47
+
48
+
49
+
50
+
51
+    // Constructor:
52
+    public Transaction(PublicKey from, PublicKey to, float value) {
53
+        this.sender = from;
54
+        this.reciepient = to;
55
+        this.value = value;
56
+
57
+    }
58
+
59
+    // This Calculates the transaction hash (which will be used as its Id)
60
+    private String calulateHash() {
61
+
62
+        return DigestUtils.sha256Hex(
63
+                StringUtil.getStringFromKey(sender) +
64
+                        StringUtil.getStringFromKey(reciepient) +
65
+                        Float.toString(value)
66
+        );
67
+    }
68
+    public void generateSignature(PrivateKey privateKey) throws NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException {
69
+        String data = StringUtil.getStringFromKey(sender) + StringUtil.getStringFromKey(reciepient) + Float.toString(value)    ;
70
+        signature = StringUtil.applyECDSASig(privateKey,data);
71
+        System.out.println(signature);
72
+    }
73
+    //Verifies the data we signed hasnt been tampered with
74
+    //public boolean verifiySignature() {
75
+    // String data = StringUtil.getStringFromKey(sender) + StringUtil.getStringFromKey(reciepient) + Float.toString(value)    ;
76
+    // return StringUtil.verifyECDSASig(sender, data, this.signature);
77
+    //}
78
+}

+ 45
- 0
ZipCoinRedJavaServer/src/main/java/com/zipcoin/Wallet/Wallet.java Zobrazit soubor

@@ -0,0 +1,45 @@
1
+package com.zipcoin.Wallet;
2
+
3
+import java.security.*;
4
+
5
+public class Wallet {
6
+
7
+    private PrivateKey privateKey;
8
+    private PublicKey publicKey;
9
+
10
+    public PrivateKey getPrivateKey() {
11
+        return privateKey;
12
+    }
13
+
14
+
15
+    public PublicKey getPublicKey() {
16
+        return publicKey;
17
+    }
18
+
19
+
20
+
21
+    public Wallet() {
22
+        generateKeyPair();
23
+    }
24
+
25
+    public void generateKeyPair() {
26
+        try {
27
+            KeyPairGenerator keyGen = KeyPairGenerator.getInstance( "DSA","SUN");
28
+
29
+            SecureRandom random = SecureRandom.getInstance("SHA1PRNG","SUN");
30
+
31
+            // Initialize the key generator and generate a KeyPair
32
+            keyGen.initialize(1024, random);   //256 bytes provides an acceptable security level
33
+            KeyPair keyPair = keyGen.generateKeyPair();
34
+            // Set the public and private keys from the keyPair
35
+            privateKey = keyPair.getPrivate();
36
+            publicKey = keyPair.getPublic();
37
+
38
+
39
+
40
+        } catch (Exception e) {
41
+            throw new RuntimeException(e);
42
+        }
43
+    }
44
+
45
+}

+ 47
- 0
ZipCoinRedJavaServer/src/test/java/com/zipcoin/redCoin/TransactionAndWallet/TransactionAndWalletTest.java Zobrazit soubor

@@ -0,0 +1,47 @@
1
+package com.zipcoin.redCoin.TransactionAndWallet;
2
+
3
+import com.zipcoin.model.Block;
4
+import com.zipcoin.model.Miner;
5
+import com.zipcoin.Wallet.Transaction;
6
+import com.zipcoin.Wallet.Wallet;
7
+
8
+import java.security.InvalidKeyException;
9
+import java.security.NoSuchAlgorithmException;
10
+import java.security.NoSuchProviderException;
11
+import java.util.ArrayList;
12
+
13
+public class TransactionAndWalletTest {
14
+    public static ArrayList<Block> blockchain = new ArrayList<Block>();
15
+    public static int difficulty = 5;
16
+
17
+
18
+    public static void main(String[] args) throws NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException {
19
+        //Setup Bouncey castle as a Security Provider
20
+        //Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
21
+        //Create the new wallets
22
+        Wallet walletA = new Wallet();
23
+        Wallet walletB = new Wallet();
24
+        //Test public and private keys
25
+        System.out.println("Wallet 1");
26
+        System.out.println("private key :wallet 1");
27
+        System.out.println(walletA.getPrivateKey().toString());
28
+        System.out.println("public key :wallet 1");
29
+        System.out.println(walletA.getPublicKey().toString());
30
+        System.out.println("\n\nWallet2");
31
+        System.out.println("public key :wallet 2");
32
+        System.out.println(walletB.getPublicKey().toString());
33
+        System.out.println("private key :wallet 2");
34
+        System.out.println(walletB.getPrivateKey().toString());
35
+        //Create a test transaction from WalletA to walletB
36
+        Transaction transaction = new Transaction(walletA.getPublicKey(), walletB.getPublicKey(), 5);
37
+        transaction.generateSignature(walletA.getPrivateKey());
38
+        //Verify the signature works and verify it from the public key
39
+
40
+
41
+        System.out.println("Is signature verified");
42
+        // System.out.println(transaction.verifiySignature());
43
+    }
44
+
45
+
46
+
47
+}