Просмотр исходного кода

now checking if try to send zero

Eugene Papko 6 лет назад
Родитель
Сommit
e5f6066924

+ 55
- 53
.idea/workspace.xml Просмотреть файл

@@ -2,8 +2,8 @@
2 2
 <project version="4">
3 3
   <component name="ChangeListManager">
4 4
     <list default="true" id="61ba4a48-7f29-46f9-8c31-1ca5b3e9447d" name="Default" comment="">
5
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
5 6
       <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
-      <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" />
7 7
     </list>
8 8
     <ignored path="$PROJECT_DIR$/target/" />
9 9
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@@ -93,8 +93,17 @@
93 93
       <file leaf-file-name="ConductTransactions.java" pinned="false" current-in-tab="true">
94 94
         <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/controller/ConductTransactions.java">
95 95
           <provider selected="true" editor-type-id="text-editor">
96
-            <state relative-caret-position="330">
97
-              <caret line="53" column="53" lean-forward="true" selection-start-line="53" selection-start-column="53" selection-end-line="53" selection-end-column="53" />
96
+            <state relative-caret-position="50">
97
+              <caret line="38" column="78" lean-forward="true" selection-start-line="38" selection-start-column="78" selection-end-line="38" selection-end-column="78" />
98
+            </state>
99
+          </provider>
100
+        </entry>
101
+      </file>
102
+      <file leaf-file-name="application.properties" pinned="false" current-in-tab="false">
103
+        <entry file="file://$PROJECT_DIR$/src/main/resources/application.properties">
104
+          <provider selected="true" editor-type-id="text-editor">
105
+            <state relative-caret-position="60">
106
+              <caret line="4" column="27" lean-forward="true" selection-start-line="4" selection-start-column="27" selection-end-line="4" selection-end-column="36" />
98 107
             </state>
99 108
           </provider>
100 109
         </entry>
@@ -102,8 +111,8 @@
102 111
       <file leaf-file-name="TransactionController.java" pinned="false" current-in-tab="false">
103 112
         <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/controller/TransactionController.java">
104 113
           <provider selected="true" editor-type-id="text-editor">
105
-            <state relative-caret-position="261">
106
-              <caret line="54" column="58" lean-forward="true" selection-start-line="54" selection-start-column="58" selection-end-line="54" selection-end-column="58" />
114
+            <state relative-caret-position="153">
115
+              <caret line="47" column="55" lean-forward="true" selection-start-line="47" selection-start-column="55" selection-end-line="47" selection-end-column="55" />
107 116
               <folding>
108 117
                 <element signature="imports" expanded="true" />
109 118
                 <element signature="e#1698#1699#0" expanded="true" />
@@ -116,21 +125,12 @@
116 125
       <file leaf-file-name="WalletController.java" pinned="false" current-in-tab="false">
117 126
         <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/controller/WalletController.java">
118 127
           <provider selected="true" editor-type-id="text-editor">
119
-            <state relative-caret-position="273">
128
+            <state relative-caret-position="525">
120 129
               <caret line="41" column="4" lean-forward="true" selection-start-line="41" selection-start-column="4" selection-end-line="41" selection-end-column="4" />
121 130
             </state>
122 131
           </provider>
123 132
         </entry>
124 133
       </file>
125
-      <file leaf-file-name="transactions" pinned="false" current-in-tab="false">
126
-        <entry file="das://787abf92-6d0c-4ede-bcc3-9a7a11567082/schema/bitcoin/table/transactions">
127
-          <provider selected="true" editor-type-id="com.intellij.database.editor.DatabaseTableFileEditorProvider">
128
-            <state>
129
-              <filtering enabled="true" />
130
-            </state>
131
-          </provider>
132
-        </entry>
133
-      </file>
134 134
     </leaf>
135 135
   </component>
136 136
   <component name="FileTemplateManagerImpl">
@@ -173,8 +173,8 @@
173 173
         <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/model/Transactions.java" />
174 174
         <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/model/Wallet.java" />
175 175
         <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/model/Block.java" />
176
-        <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/controller/ConductTransactions.java" />
177 176
         <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/controller/TransactionController.java" />
177
+        <option value="$PROJECT_DIR$/src/main/java/com/buecoin01/controller/ConductTransactions.java" />
178 178
       </list>
179 179
     </option>
180 180
   </component>
@@ -385,6 +385,9 @@
385 385
       </list>
386 386
     </recent_temporary>
387 387
   </component>
388
+  <component name="SpringRepositoriesView">
389
+    <option name="showModules" value="false" />
390
+  </component>
388 391
   <component name="SvnConfiguration">
389 392
     <configuration />
390 393
   </component>
@@ -403,7 +406,7 @@
403 406
     <servers />
404 407
   </component>
405 408
   <component name="TimeTrackingManager">
406
-    <option name="totallyTimeSpent" value="56087000" />
409
+    <option name="totallyTimeSpent" value="57947000" />
407 410
   </component>
408 411
   <component name="TodoView">
409 412
     <todo-panel id="selected-file">
@@ -419,27 +422,26 @@
419 422
     <editor active="true" />
420 423
     <layout>
421 424
       <window_info anchor="right" id="Palette" order="3" />
422
-      <window_info anchor="bottom" id="Event Log" order="7" side_tool="true" />
425
+      <window_info anchor="bottom" id="Event Log" order="7" sideWeight="0.5007153" side_tool="true" />
423 426
       <window_info anchor="right" id="Maven Projects" order="3" />
424 427
       <window_info anchor="bottom" id="Database Changes" order="7" show_stripe_button="false" />
425 428
       <window_info id="Capture Tool" order="2" />
426 429
       <window_info id="Designer" order="2" />
427
-      <window_info anchor="right" id="Database" order="3" visible="true" weight="0.14878398" />
430
+      <window_info anchor="right" id="Database" order="3" weight="0.22317597" />
428 431
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
429 432
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
430 433
       <window_info id="UI Designer" order="2" />
431 434
       <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
432 435
       <window_info anchor="bottom" id="TODO" order="6" />
433
-      <window_info anchor="bottom" id="Messages" order="8" weight="0.27462685" />
436
+      <window_info anchor="bottom" id="Messages" order="8" weight="0.2742857" />
434 437
       <window_info anchor="right" id="Palette&#9;" order="3" />
435 438
       <window_info id="Image Layers" order="2" />
436 439
       <window_info anchor="bottom" id="Java Enterprise" order="7" />
437 440
       <window_info anchor="right" id="Capture Analysis" order="3" />
438
-      <window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.32714286" />
441
+      <window_info anchor="bottom" id="Run" order="2" visible="true" weight="0.32714286" />
439 442
       <window_info anchor="bottom" id="Version Control" order="7" />
440
-      <window_info anchor="bottom" id="Spring" order="7" />
441
-      <window_info anchor="bottom" id="Terminal" order="7" weight="0.32857144" />
442
-      <window_info anchor="bottom" id="Database Console" order="0" weight="0.3282123" />
443
+      <window_info anchor="bottom" id="Spring" order="7" sideWeight="0.49928468" />
444
+      <window_info anchor="bottom" id="Terminal" order="7" sideWeight="0.49928468" weight="0.32857144" />
443 445
       <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.2532189" />
444 446
       <window_info anchor="right" id="Bean Validation" order="3" />
445 447
       <window_info id="Web" order="2" side_tool="true" />
@@ -470,7 +472,7 @@
470 472
       <window_info anchor="right" id="Capture Analysis" order="4" />
471 473
       <window_info anchor="bottom" id="TODO" order="7" weight="0.32935324" />
472 474
       <window_info anchor="bottom" id="Inspection" order="6" weight="0.4" />
473
-      <window_info anchor="bottom" id="Database Console" order="0" weight="0.3282123" />
475
+      <window_info anchor="bottom" id="Database Console" order="0" weight="0.32714286" />
474 476
       <window_info anchor="bottom" id="Cvs" order="5" weight="0.25" />
475 477
       <window_info id="UI Designer" order="4" />
476 478
       <window_info anchor="bottom" id="Find" order="2" />
@@ -527,9 +529,6 @@
527 529
     </breakpoint-manager>
528 530
   </component>
529 531
   <component name="editorHistoryManager">
530
-    <entry file="file://$PROJECT_DIR$/.idea/workspace.xml">
531
-      <provider selected="true" editor-type-id="text-editor" />
532
-    </entry>
533 532
     <entry file="file://$PROJECT_DIR$/src/main/resources/application.properties">
534 533
       <provider selected="true" editor-type-id="text-editor">
535 534
         <state relative-caret-position="150">
@@ -760,13 +759,6 @@
760 759
     <entry file="file://$APPLICATION_CONFIG_DIR$/consoles/db/787abf92-6d0c-4ede-bcc3-9a7a11567082/console.sql">
761 760
       <provider selected="true" editor-type-id="text-editor" />
762 761
     </entry>
763
-    <entry file="file://$PROJECT_DIR$/src/main/resources/application.properties">
764
-      <provider selected="true" editor-type-id="text-editor">
765
-        <state relative-caret-position="150">
766
-          <caret line="10" lean-forward="true" selection-start-line="10" selection-end-line="10" />
767
-        </state>
768
-      </provider>
769
-    </entry>
770 762
     <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/Repositories/TransactionRepository.java">
771 763
       <provider selected="true" editor-type-id="text-editor">
772 764
         <state relative-caret-position="165">
@@ -781,6 +773,23 @@
781 773
         </state>
782 774
       </provider>
783 775
     </entry>
776
+    <entry file="file://$PROJECT_DIR$/.idea/workspace.xml">
777
+      <provider selected="true" editor-type-id="text-editor">
778
+        <state relative-caret-position="121">
779
+          <caret line="16" column="41" selection-start-line="16" selection-start-column="41" selection-end-line="16" selection-end-column="41" />
780
+        </state>
781
+      </provider>
782
+    </entry>
783
+    <entry file="file://$APPLICATION_CONFIG_DIR$/consoles/db/8309d086-aeb4-49a5-b395-6f51573b4179/console.sql">
784
+      <provider selected="true" editor-type-id="text-editor" />
785
+    </entry>
786
+    <entry file="file://$PROJECT_DIR$/src/main/resources/application.properties">
787
+      <provider selected="true" editor-type-id="text-editor">
788
+        <state relative-caret-position="60">
789
+          <caret line="4" column="27" lean-forward="true" selection-start-line="4" selection-start-column="27" selection-end-line="4" selection-end-column="36" />
790
+        </state>
791
+      </provider>
792
+    </entry>
784 793
     <entry file="das://787abf92-6d0c-4ede-bcc3-9a7a11567082/schema/bitcoin/table/wallet">
785 794
       <provider selected="true" editor-type-id="com.intellij.database.editor.DatabaseTableFileEditorProvider">
786 795
         <state>
@@ -795,24 +804,10 @@
795 804
         </state>
796 805
       </provider>
797 806
     </entry>
798
-    <entry file="file://$PROJECT_DIR$/.idea/workspace.xml">
799
-      <provider selected="true" editor-type-id="text-editor">
800
-        <state relative-caret-position="121">
801
-          <caret line="16" column="41" selection-start-line="16" selection-start-column="41" selection-end-line="16" selection-end-column="41" />
802
-        </state>
803
-      </provider>
804
-    </entry>
805
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/controller/WalletController.java">
806
-      <provider selected="true" editor-type-id="text-editor">
807
-        <state relative-caret-position="273">
808
-          <caret line="41" column="4" lean-forward="true" selection-start-line="41" selection-start-column="4" selection-end-line="41" selection-end-column="4" />
809
-        </state>
810
-      </provider>
811
-    </entry>
812 807
     <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/controller/TransactionController.java">
813 808
       <provider selected="true" editor-type-id="text-editor">
814
-        <state relative-caret-position="261">
815
-          <caret line="54" column="58" lean-forward="true" selection-start-line="54" selection-start-column="58" selection-end-line="54" selection-end-column="58" />
809
+        <state relative-caret-position="153">
810
+          <caret line="47" column="55" lean-forward="true" selection-start-line="47" selection-start-column="55" selection-end-line="47" selection-end-column="55" />
816 811
           <folding>
817 812
             <element signature="imports" expanded="true" />
818 813
             <element signature="e#1698#1699#0" expanded="true" />
@@ -821,10 +816,17 @@
821 816
         </state>
822 817
       </provider>
823 818
     </entry>
819
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/controller/WalletController.java">
820
+      <provider selected="true" editor-type-id="text-editor">
821
+        <state relative-caret-position="525">
822
+          <caret line="41" column="4" lean-forward="true" selection-start-line="41" selection-start-column="4" selection-end-line="41" selection-end-column="4" />
823
+        </state>
824
+      </provider>
825
+    </entry>
824 826
     <entry file="file://$PROJECT_DIR$/src/main/java/com/buecoin01/controller/ConductTransactions.java">
825 827
       <provider selected="true" editor-type-id="text-editor">
826
-        <state relative-caret-position="330">
827
-          <caret line="53" column="53" lean-forward="true" selection-start-line="53" selection-start-column="53" selection-end-line="53" selection-end-column="53" />
828
+        <state relative-caret-position="50">
829
+          <caret line="38" column="78" lean-forward="true" selection-start-line="38" selection-start-column="78" selection-end-line="38" selection-end-column="78" />
828 830
         </state>
829 831
       </provider>
830 832
     </entry>

+ 1
- 1
src/main/java/com/buecoin01/controller/ConductTransactions.java Просмотреть файл

@@ -33,7 +33,7 @@ public class ConductTransactions {
33 33
 
34 34
         Wallet sender = walletRepository.findWalletByPublicId(transaction.getFromId()).get(0);
35 35
 
36
-           if (sender.getAmount() >= transaction.getAmount() && !sender.getPublicId().equals(receiver.getPublicId())) {
36
+           if (sender.getAmount() >= transaction.getAmount() && !sender.getPublicId().equals(receiver.getPublicId()) && transaction.getAmount()!=0) {
37 37
 
38 38
         logger.info("controller is hitting this method");
39 39
                sender.setAmount(sender.getAmount() - transaction.getAmount());

Двоичные данные
target/classes/com/buecoin01/controller/ConductTransactions.class Просмотреть файл