Skip to content

Commit

Permalink
amihaiemil#44 changed double to string
Browse files Browse the repository at this point in the history
  • Loading branch information
Ammar Atef committed Feb 27, 2019
1 parent 1f35940 commit 617e3fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
18 changes: 8 additions & 10 deletions src/main/java/com/amihaiemil/zold/RtWallet.java
Expand Up @@ -92,19 +92,17 @@ public String getId() throws IOException {
}

@Override
public double balance() throws IOException{
public String balance() throws IOException{
final HttpGet walletBalance = new HttpGet(
URI.create(this.baseUri.toString() + "/balance")
);
try {
return Double.parseDouble(
this.client.execute(
walletBalance,
new ReadString(
new MatchStatus(
walletBalance.getURI(),
HttpStatus.SC_OK
)
return this.client.execute(
walletBalance,
new ReadString(
new MatchStatus(
walletBalance.getURI(),
HttpStatus.SC_OK
)
)
);
Expand All @@ -116,7 +114,7 @@ public double balance() throws IOException{
@Override
public void pay(
final String keygap, final String user,
final double amount, final String details
final String amount, final String details
) throws IOException {

final HttpPost request = new HttpPost(
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/amihaiemil/zold/Wallet.java
Expand Up @@ -49,7 +49,7 @@ public interface Wallet {
* @return Balance
* @throws IOException If there's a networking problem.
*/
double balance() throws IOException;
String balance() throws IOException;

/**
* Pay to another wallet.
Expand All @@ -62,7 +62,7 @@ public interface Wallet {
*/
void pay(
final String keygap, final String user,
final double amount, final String details
final String amount, final String details
)throws IOException;

/**
Expand Down

0 comments on commit 617e3fd

Please sign in to comment.