|
19 | 19 | import javax.swing.JCheckBox;
|
20 | 20 | import javax.swing.JComboBox;
|
21 | 21 | import javax.swing.JLabel;
|
| 22 | +import javax.swing.JOptionPane; |
22 | 23 | import javax.swing.JPanel;
|
23 | 24 | import javax.swing.JSpinner;
|
24 | 25 | import javax.swing.JSplitPane;
|
|
30 | 31 | import org.slf4j.LoggerFactory;
|
31 | 32 |
|
32 | 33 | import convex.api.Convex;
|
| 34 | +import convex.core.Networks; |
33 | 35 | import convex.core.Result;
|
34 | 36 | import convex.core.crypto.AKeyPair;
|
35 | 37 | import convex.core.cvm.transactions.ATransaction;
|
|
38 | 40 | import convex.core.cvm.transactions.Transfer;
|
39 | 41 | import convex.core.data.ACell;
|
40 | 42 | import convex.core.data.AVector;
|
| 43 | +import convex.core.data.Hash; |
41 | 44 | import convex.core.cvm.Address;
|
42 | 45 | import convex.core.data.Strings;
|
43 | 46 | import convex.core.lang.Reader;
|
@@ -83,6 +86,12 @@ public StressPanel(Convex peerView) {
|
83 | 86 | btnRun = new JButton("Run Test");
|
84 | 87 | actionPanel.add(btnRun);
|
85 | 88 | btnRun.addActionListener(e -> {
|
| 89 | + Hash network=peerView.getLocalServer().getPeer().getGenesisHash(); |
| 90 | + if (network.equals(Networks.PRONONET_GENESIS)) { |
| 91 | + int confirm=JOptionPane.showConfirmDialog(this, "This is the live network. Running a stress test is likley to be expensive! Are you really sure you want to do this?", "Run test on Live network?", JOptionPane.WARNING_MESSAGE); |
| 92 | + if (confirm!=JOptionPane.OK_OPTION) return; |
| 93 | + } |
| 94 | + |
86 | 95 | btnRun.setEnabled(false);
|
87 | 96 | Address address=peerConvex.getAddress();
|
88 | 97 | AKeyPair kp=peerConvex.getKeyPair();
|
@@ -238,7 +247,7 @@ protected String doStressRun() throws Exception {
|
238 | 247 |
|
239 | 248 | // Generate client accounts
|
240 | 249 | StringBuilder cmdsb=new StringBuilder();
|
241 |
| - cmdsb.append("(let [f (fn [k] (let [a (create-account k)] (transfer a 1000000000) a))] "); |
| 250 | + cmdsb.append("(let [f (fn [k] (let [a (deploy `(do (set-key ~k) (set-controller #13))] (transfer a 1000000000) a))] "); |
242 | 251 | cmdsb.append(" (mapv f [");
|
243 | 252 | for (int i=0; i<clientCount; i++) {
|
244 | 253 | AKeyPair kp=AKeyPair.generate();
|
|
0 commit comments