Skip to content

Commit

Permalink
Deserialization fix (#40)
Browse files Browse the repository at this point in the history
* remove jackson library in favor gson
* clean up
* version and changelog
  • Loading branch information
JohnnyJumper authored Apr 30, 2021
1 parent 3e3b37e commit cf8c26f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.13.2
* Remove Jakson dependency in favor of gson

## 1.13.1
* Fix the deserialization bug with Jakson on NetworkConfigLoader.java

Expand Down
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ dependencies {
implementation 'com.esaulpaugh:headlong:3.4.1'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'org.bouncycastle:bcprov-jdk15on:1.65.01'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.11.4'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.11.4'

compileOnly 'org.projectlombok:lombok-maven-plugin:1.18.16.0'

annotationProcessor 'org.projectlombok:lombok:1.18.16'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.unstoppabledomains.config.network;

import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.Gson;
import com.unstoppabledomains.config.network.model.Contract;
import com.unstoppabledomains.config.network.model.Contracts;
import com.unstoppabledomains.config.network.model.Network;
Expand Down Expand Up @@ -41,9 +39,7 @@ private static NetworkConfig initNetworkConfig() {
try {
final InputStreamReader reader = new InputStreamReader(NetworkConfigLoader.class.getResourceAsStream(CONFIG_FILE));
final String jsonString = new BufferedReader(reader).lines().collect(Collectors.joining("\n"));
final ObjectMapper mapper = new ObjectMapper().setVisibility(PropertyAccessor.FIELD, Visibility.ANY);

config = mapper.readValue(jsonString, NetworkConfig.class);
config = new Gson().fromJson(jsonString, NetworkConfig.class);
} catch (Exception e) {
throw new RuntimeException("Couldn't load network config", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ public String getRecord(String recordKey, BigInteger tokenID) throws Exception {
}

public ProxyData getProxyData(String[] records, BigInteger tokenID) throws NamingServiceException {
Object[] args = new Object[2];
args[0] = records;
args[1] = tokenID;
Object[] args = { records, tokenID };
return fetchData(args);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
package com.unstoppabledomains.resolution.naming.service;

import com.unstoppabledomains.config.network.NetworkConfigLoader;
import com.unstoppabledomains.config.network.model.Network;
import com.unstoppabledomains.exceptions.ContractCallException;
import com.unstoppabledomains.exceptions.dns.DnsException;
import com.unstoppabledomains.exceptions.ns.NSExceptionCode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "1.13.1"
"version": "1.13.2"
}

0 comments on commit cf8c26f

Please sign in to comment.