File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
hd-wallet/src/it/java/com/bloxbean/cardano/hdwallet Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,31 @@ protected static void topUpFund(String address, long adaAmount) {
7979 }
8080 }
8181
82+ protected static void resetNetwork () {
83+ try {
84+ // URL to reset the network
85+ String url = DEVKIT_ADMIN_BASE_URL + "local-cluster/api/admin/devnet/reset" ;
86+ URL obj = new URL (url );
87+ HttpURLConnection connection = (HttpURLConnection ) obj .openConnection ();
88+
89+ // Set request method to POST
90+ connection .setRequestMethod ("POST" );
91+ connection .setRequestProperty ("Content-Type" , "application/json; utf-8" );
92+ connection .setRequestProperty ("Accept" , "application/json" );
93+ connection .setDoOutput (true );
94+
95+ // Check the response code
96+ int responseCode = connection .getResponseCode ();
97+ if (responseCode == HttpURLConnection .HTTP_OK ) {
98+ System .out .println ("Funds topped up successfully." );
99+ } else {
100+ System .out .println ("Failed to top up funds. Response code: " + responseCode );
101+ }
102+ } catch (Exception e ) {
103+ e .printStackTrace ();
104+ }
105+ }
106+
82107 public void waitForTransaction (Result <String > result ) {
83108 try {
84109 if (result .isSuccessful ()) { //Wait for transaction to be mined
You can’t perform that action at this time.
0 commit comments