|
| 1 | +package com.nitinsurana.bitcoinlitecoin.rpcconnector; |
| 2 | + |
| 3 | +import com.google.gson.JsonArray; |
| 4 | +import com.nitinsurana.bitcoinlitecoin.rpcconnector.exception.CryptoCurrencyRpcException; |
| 5 | +import com.nitinsurana.bitcoinlitecoin.rpcconnector.pojo.Transaction; |
| 6 | + |
| 7 | +import java.math.BigDecimal; |
| 8 | + |
| 9 | +/** |
| 10 | + * Created by d.romantsov on 20.03.2017. |
| 11 | + */ |
| 12 | +public class MockCryptoCurrencyRpc extends CryptoCurrencyRPC { |
| 13 | + public MockCryptoCurrencyRpc() { |
| 14 | + super(null, null, null, null, null, 0); |
| 15 | + } |
| 16 | + |
| 17 | + @Override |
| 18 | + public boolean backupWallet(String destination) throws CryptoCurrencyRpcException { |
| 19 | + return true; |
| 20 | + } |
| 21 | + |
| 22 | + @Override |
| 23 | + public String dumpPrivateKey(String address) throws CryptoCurrencyRpcException { |
| 24 | + return address; |
| 25 | + } |
| 26 | + |
| 27 | + @Override |
| 28 | + public String encryptWallet(String passphrase) throws CryptoCurrencyRpcException { |
| 29 | + return passphrase; |
| 30 | + } |
| 31 | + |
| 32 | + @Override |
| 33 | + public String getAccount(String address) throws CryptoCurrencyRpcException { |
| 34 | + return "mockAccount"; |
| 35 | + } |
| 36 | + |
| 37 | + @Override |
| 38 | + public String getAccountAddress(String account) throws CryptoCurrencyRpcException { |
| 39 | + return "n1v1XpeNaC124r9DXcBAka2XgJpcMpUBMB"; |
| 40 | + } |
| 41 | + |
| 42 | + @Override |
| 43 | + public JsonArray getAddressesByAccount(String account) throws CryptoCurrencyRpcException { |
| 44 | + return new JsonArray(); |
| 45 | + } |
| 46 | + |
| 47 | + @Override |
| 48 | + public BigDecimal getBalance(String account) throws CryptoCurrencyRpcException { |
| 49 | + return BigDecimal.TEN; |
| 50 | + } |
| 51 | + |
| 52 | + @Override |
| 53 | + public BigDecimal getBalance() throws CryptoCurrencyRpcException { |
| 54 | + return BigDecimal.TEN; |
| 55 | + } |
| 56 | + |
| 57 | + @Override |
| 58 | + public BigDecimal getReceivedByAccount(String account) throws CryptoCurrencyRpcException { |
| 59 | + return BigDecimal.TEN; |
| 60 | + } |
| 61 | + |
| 62 | + @Override |
| 63 | + public String getNewAddress() throws CryptoCurrencyRpcException { |
| 64 | + return "n1v1XpeNaC124r9DXcBAka2XgJpcMpUBMB"; |
| 65 | + } |
| 66 | + |
| 67 | + @Override |
| 68 | + public String getInfo() throws CryptoCurrencyRpcException { |
| 69 | + return "MockInfo"; |
| 70 | + } |
| 71 | + |
| 72 | + @Override |
| 73 | + public String getNewAddress(String account) throws CryptoCurrencyRpcException { |
| 74 | + return "n1v1XpeNaC124r9DXcBAka2XgJpcMpUBMB"; |
| 75 | + } |
| 76 | + |
| 77 | + @Override |
| 78 | + public BigDecimal getReceivedByAddress(String address) throws CryptoCurrencyRpcException { |
| 79 | + return BigDecimal.TEN; |
| 80 | + } |
| 81 | + |
| 82 | + @Override |
| 83 | + public Transaction getTransaction(String txid) throws CryptoCurrencyRpcException { |
| 84 | + return new Transaction(); |
| 85 | + } |
| 86 | + |
| 87 | + @Override |
| 88 | + public String sendFrom(String fromAccount, String toAddress, BigDecimal amount) throws CryptoCurrencyRpcException { |
| 89 | + return "asdasdasdasdasd"; |
| 90 | + } |
| 91 | + |
| 92 | + @Override |
| 93 | + public boolean move(String fromAccount, String toAccount, BigDecimal amount, String comment) throws CryptoCurrencyRpcException { |
| 94 | + return true; |
| 95 | + } |
| 96 | + |
| 97 | + @Override |
| 98 | + public String sendToAddress(String toAddress, BigDecimal amount) throws CryptoCurrencyRpcException { |
| 99 | + return "asdasdasdasdasd"; |
| 100 | + } |
| 101 | + |
| 102 | + @Override |
| 103 | + public boolean validateAddress(String address) throws CryptoCurrencyRpcException { |
| 104 | + return true; |
| 105 | + } |
| 106 | + |
| 107 | + |
| 108 | + @Override |
| 109 | + public boolean wallePassphrase(String passphrase, int timeout) throws CryptoCurrencyRpcException { |
| 110 | + return true; |
| 111 | + } |
| 112 | + |
| 113 | + @Override |
| 114 | + public void setAccount(String address, String account) throws CryptoCurrencyRpcException { |
| 115 | + |
| 116 | + } |
| 117 | +} |
0 commit comments