Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #300 from klaytn/release/v1.8.0
Browse files Browse the repository at this point in the history
[Master] release/v1.8.0 QA Sign-off
  • Loading branch information
aeharvlee authored Mar 7, 2022
2 parents 6c4be43 + d5e7fd6 commit d706617
Show file tree
Hide file tree
Showing 70 changed files with 11,056 additions and 239 deletions.
5 changes: 1 addition & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defaults: &defaults
machine_ubuntu: &machine_ubuntu
working_directory: ~/circleci-caver-java-major
machine:
image: ubuntu-1604:201903-01
image: ubuntu-2004:202010-01

android_machine_ubuntu: &android_machine_ubuntu
working_directory: ~/circleci-caver-java-android
Expand Down Expand Up @@ -195,9 +195,6 @@ jobs:
command: ./gradlew connectedDebugAndroidTest --debug --stacktrace
- store_test_results:
path: android_instrumented_test/build/outputs/androidTest-results/connected
- store_artifacts:
path: ~/circleci-caver-java-android/
destination: adb.log

build_test_android:
<<: *android_machine_ubuntu
Expand Down
4 changes: 2 additions & 2 deletions .circleci/images/docker-compose.yml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ buildscript {
ext.androidxJunitVersion = '1.1.2'
ext.androidxTestRunnerVersion = '1.3.0'
ext.androidxTestRulesVersion = '1.3.0'
ext.jacksonDataBindVersion = '2.13.1'
}

plugins {
Expand All @@ -33,7 +34,7 @@ apply plugin: 'io.codearte.nexus-staging'


allprojects {
version '1.6.4'
version '1.8.0'
group 'com.klaytn.caver'
description 'caver-java project'

Expand Down
1 change: 1 addition & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ dependencies {
}

compile "com.github.ipfs:java-ipfs-http-client:$ipfsVersion"
implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonDataBindVersion"
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/*
* Copyright 2022 The caver-java Authors
*
* Licensed under the Apache License, Version 2.0 (the “License”);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an “AS IS” BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.klaytn.caver.methods.response;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.klaytn.caver.transaction.utils.AccessList;
import com.klaytn.caver.transaction.utils.AccessTuple;
import org.web3j.protocol.core.Response;

import java.io.IOException;

public class AccessListResult extends Response<AccessListResult.AccessListResultData> {

@Override
public void setResult(AccessListResultData result) {
super.setResult(result);
}

@JsonDeserialize(using = AccessListResultData.AccessListResultDeserializer.class)
public static class AccessListResultData {
AccessList accessList;
String error;
String gasUsed;

public AccessListResultData(AccessList accessList, String error, String gasUsed) {
this.accessList = accessList;
this.error = error;
this.gasUsed = gasUsed;
}

public AccessList getAccessList() {
return accessList;
}

public void setAccessList(AccessList accessList) {
this.accessList = accessList;
}

public String getError() {
return error;
}

public void setError(String error) {
this.error = error;
}

public String getGasUsed() {
return gasUsed;
}

public void setGasUsed(String gasUsed) {
this.gasUsed = gasUsed;
}

public static class AccessListResultDeserializer extends JsonDeserializer<AccessListResultData> {
@Override
public AccessListResultData deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
ObjectMapper objectMapper = new ObjectMapper();
JsonNode node = p.getCodec().readTree(p);

AccessList accessList = new AccessList();
JsonNode accessListNode = node.get("accessList");
for (JsonNode innerNode : accessListNode) {
AccessTuple accessTuple = objectMapper.treeToValue(innerNode, AccessTuple.class);
accessList.add(accessTuple);
}

AccessListResultData accessListResultData = new AccessListResultData(accessList, null, "0x0");
JsonNode error = node.get("error");
if (error != null) {
accessListResultData.setError(error.textValue());
}
JsonNode gasUsed = node.get("gasUsed");
if (gasUsed != null) {
accessListResultData.setGasUsed(gasUsed.textValue());
}
return accessListResultData;
}
}
}
}
16 changes: 15 additions & 1 deletion core/src/main/java/com/klaytn/caver/methods/response/Block.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,15 @@ public static class BlockData<T> {
*/
private String voteData;

/**
* Base fee per gas
*/
private String baseFeePerGas;

public BlockData() {
}

public BlockData(String number, String hash, String parentHash, String logsBloom, String transactionsRoot, String stateRoot, String receiptsRoot, String reward, String blockScore, String totalBlockScore, String extraData, String size, String gasUsed, String timestamp, String timestampFoS, List transactions, String governanceData, String voteData) {
public BlockData(String number, String hash, String parentHash, String logsBloom, String transactionsRoot, String stateRoot, String receiptsRoot, String reward, String blockScore, String totalBlockScore, String extraData, String size, String gasUsed, String timestamp, String timestampFoS, List transactions, String governanceData, String voteData, String baseFeePerGas) {
this.number = number;
this.hash = hash;
this.parentHash = parentHash;
Expand All @@ -155,6 +160,7 @@ public BlockData(String number, String hash, String parentHash, String logsBloom
this.transactions = transactions;
this.governanceData = governanceData;
this.voteData = voteData;
this.baseFeePerGas = baseFeePerGas;
}

public String getNumber() {
Expand Down Expand Up @@ -302,6 +308,14 @@ public String getTotalBlockScore() {
public void setTotalBlockScore(String totalBlockScore) {
this.totalBlockScore = totalBlockScore;
}

public String getBaseFeePerGas() {
return baseFeePerGas;
}

public void setBaseFeePerGas(String baseFeePerGas) {
this.baseFeePerGas = baseFeePerGas;
}
}

public static class ResponseDeserializer extends JsonDeserializer<Block.BlockData> {
Expand Down
Loading

0 comments on commit d706617

Please sign in to comment.