Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## Unreleased

## 0.1.2 - 2018-12-10

### Changed
- Create transaction with a list instead of a map

## 0.1.1 - 2018-12-10

### Fixed:
Expand Down
17 changes: 9 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ plugins {
apply plugin:'java'
apply plugin:'maven'
apply plugin:'maven-publish'
apply plugin:'signing'

repositories {
jcenter()
Expand All @@ -35,20 +34,20 @@ uploadArchives {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

// repository(url: "file://${buildDir}/repo") {}
repository(url: "file://${buildDir}/repo") {}

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
authentication(userName: '', password: '')
}
//repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
// authentication(userName: '', password: '')
// }

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

pom.project {
groupId = 'org.arkecosystem'
version = '0.1.1'
artifactId = 'arkecosystem-client'
version = '0.1.2'
artifactId = 'client'

name = 'java-client'
description = 'A simple Java API client for the ARK Blockchain.'
Expand Down Expand Up @@ -80,14 +79,16 @@ uploadArchives {
scm {
connection = 'scm:git:git://github.com/ArkEcosystem/java-client.git'
developerConnection = 'scm:git:ssh://github.com:ArkEcosystem/java-client.git'
url = 'https://github.com/ArkEcosystem/java-client/tree/0.1.1'
url = 'https://github.com/ArkEcosystem/java-client/tree/0.1.2'
}
}
}
}
}

if (project.hasProperty("signing.keyId")) {
apply plugin:'signing'

signing {
sign configurations.archives
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import org.arkecosystem.client.http.Client;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

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

public LinkedTreeMap<String, Object> create(Map<String, Object> transactions) throws IOException {
return this.client.post("transactions", transactions);
public LinkedTreeMap<String, Object> create(List<String> transactions) throws IOException {
HashMap<String, List<String>> params = new HashMap<>();
params.put("transactions", transactions);
return this.client.post("transactions", params);
}

public LinkedTreeMap<String, Object> show(String id) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;

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

Expand Down