forked from tronprotocol/java-tron
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request tronprotocol#3615 from tronprotocol/remove-blackho…
…le-account add the query burn trx interface
- Loading branch information
Showing
9 changed files
with
149 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
framework/src/main/java/org/tron/core/services/http/GetBurnTrxServlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.tron.core.services.http; | ||
|
||
import java.io.IOException; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Component; | ||
import org.tron.core.db.Manager; | ||
|
||
|
||
@Component | ||
@Slf4j(topic = "API") | ||
public class GetBurnTrxServlet extends RateLimiterServlet { | ||
|
||
@Autowired | ||
private Manager manager; | ||
|
||
protected void doGet(HttpServletRequest request, HttpServletResponse response) { | ||
try { | ||
long value = manager.getDynamicPropertiesStore().getBurnTrxAmount(); | ||
response.getWriter().println("{\"burnTrxAmount\": " + value + "}"); | ||
} catch (Exception e) { | ||
logger.error("", e); | ||
try { | ||
response.getWriter().println(Util.printErrorMsg(e)); | ||
} catch (IOException ioe) { | ||
logger.debug("IOException: {}", ioe.getMessage()); | ||
} | ||
} | ||
} | ||
|
||
protected void doPost(HttpServletRequest request, HttpServletResponse response) { | ||
doGet(request, response); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...rk/src/main/java/org/tron/core/services/interfaceOnPBFT/http/GetBurnTrxOnPBFTServlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.tron.core.services.interfaceOnPBFT.http; | ||
|
||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Component; | ||
import org.tron.core.services.http.GetBurnTrxServlet; | ||
import org.tron.core.services.interfaceOnPBFT.WalletOnPBFT; | ||
|
||
|
||
@Component | ||
@Slf4j(topic = "API") | ||
public class GetBurnTrxOnPBFTServlet extends GetBurnTrxServlet { | ||
|
||
@Autowired | ||
private WalletOnPBFT walletOnPBFT; | ||
|
||
protected void doGet(HttpServletRequest request, HttpServletResponse response) { | ||
walletOnPBFT.futureGet(() -> super.doGet(request, response)); | ||
} | ||
|
||
protected void doPost(HttpServletRequest request, HttpServletResponse response) { | ||
walletOnPBFT.futureGet(() -> super.doPost(request, response)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...ain/java/org/tron/core/services/interfaceOnSolidity/http/GetBurnTrxOnSolidityServlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.tron.core.services.interfaceOnSolidity.http; | ||
|
||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Component; | ||
import org.tron.core.services.http.GetBurnTrxServlet; | ||
import org.tron.core.services.interfaceOnSolidity.WalletOnSolidity; | ||
|
||
|
||
@Component | ||
@Slf4j(topic = "API") | ||
public class GetBurnTrxOnSolidityServlet extends GetBurnTrxServlet { | ||
|
||
@Autowired | ||
private WalletOnSolidity walletOnSolidity; | ||
|
||
protected void doGet(HttpServletRequest request, HttpServletResponse response) { | ||
walletOnSolidity.futureGet(() -> super.doGet(request, response)); | ||
} | ||
|
||
protected void doPost(HttpServletRequest request, HttpServletResponse response) { | ||
walletOnSolidity.futureGet(() -> super.doPost(request, response)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters