Skip to content

Commit 90d265a

Browse files
spkjpfaustbrian
authored andcommitted
refactor: use list instead of map (#23)
* refactor: pass list instead of map * chore: build.gradle * chore: changelog
1 parent 51e3c05 commit 90d265a

4 files changed

Lines changed: 22 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## Unreleased
99

10+
## 0.1.2 - 2018-12-10
11+
12+
### Changed
13+
- Create transaction with a list instead of a map
14+
1015
## 0.1.1 - 2018-12-10
1116

1217
### Fixed:

build.gradle

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ plugins {
99
apply plugin:'java'
1010
apply plugin:'maven'
1111
apply plugin:'maven-publish'
12-
apply plugin:'signing'
1312

1413
repositories {
1514
jcenter()
@@ -35,20 +34,20 @@ uploadArchives {
3534
mavenDeployer {
3635
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
3736

38-
// repository(url: "file://${buildDir}/repo") {}
37+
repository(url: "file://${buildDir}/repo") {}
3938

40-
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
41-
authentication(userName: '', password: '')
42-
}
39+
//repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
40+
// authentication(userName: '', password: '')
41+
// }
4342

4443
// snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
4544
// authentication(userName: ossrhUsername, password: ossrhPassword)
4645
// }
4746

4847
pom.project {
4948
groupId = 'org.arkecosystem'
50-
version = '0.1.1'
51-
artifactId = 'arkecosystem-client'
49+
version = '0.1.2'
50+
artifactId = 'client'
5251

5352
name = 'java-client'
5453
description = 'A simple Java API client for the ARK Blockchain.'
@@ -80,14 +79,16 @@ uploadArchives {
8079
scm {
8180
connection = 'scm:git:git://github.com/ArkEcosystem/java-client.git'
8281
developerConnection = 'scm:git:ssh://github.com:ArkEcosystem/java-client.git'
83-
url = 'https://github.com/ArkEcosystem/java-client/tree/0.1.1'
82+
url = 'https://github.com/ArkEcosystem/java-client/tree/0.1.2'
8483
}
8584
}
8685
}
8786
}
8887
}
8988

9089
if (project.hasProperty("signing.keyId")) {
90+
apply plugin:'signing'
91+
9192
signing {
9293
sign configurations.archives
9394
}

src/main/java/org/arkecosystem/client/api/two/Transactions.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import org.arkecosystem.client.http.Client;
55

66
import java.io.IOException;
7+
import java.util.HashMap;
8+
import java.util.List;
79
import java.util.Map;
810

911
public class Transactions {
@@ -17,8 +19,10 @@ public LinkedTreeMap<String, Object> all() throws IOException {
1719
return this.client.get("transactions");
1820
}
1921

20-
public LinkedTreeMap<String, Object> create(Map<String, Object> transactions) throws IOException {
21-
return this.client.post("transactions", transactions);
22+
public LinkedTreeMap<String, Object> create(List<String> transactions) throws IOException {
23+
HashMap<String, List<String>> params = new HashMap<>();
24+
params.put("transactions", transactions);
25+
return this.client.post("transactions", params);
2226
}
2327

2428
public LinkedTreeMap<String, Object> show(String id) throws IOException {

src/test/java/org/arkecosystem/client/api/two/TransactionsTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.junit.jupiter.api.Test;
77

88
import java.io.IOException;
9+
import java.util.ArrayList;
910
import java.util.HashMap;
1011

1112
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -22,7 +23,7 @@ void all() throws IOException {
2223
@Test
2324
void create() throws IOException {
2425
Connection<Two> connection = MockHelper.connection(2);
25-
LinkedTreeMap<String, Object> actual = connection.api().transactions.create(new HashMap<>());
26+
LinkedTreeMap<String, Object> actual = connection.api().transactions.create(new ArrayList<>());
2627
assertTrue((boolean) actual.get("success"));
2728
}
2829

0 commit comments

Comments
 (0)