-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #149 from kyonRay/master
Release v1.4.0
- Loading branch information
Showing
16 changed files
with
246 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v1.3.1 | ||
v1.4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.webank.wecrosssdk.rpc.common; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import java.util.Arrays; | ||
import java.util.LinkedList; | ||
import java.util.List; | ||
|
||
public class Block { | ||
@JsonIgnore public byte[] rawBytes; | ||
public BlockHeader blockHeader; | ||
public List<String> transactionsHashes = new LinkedList<>(); | ||
|
||
public BlockHeader getBlockHeader() { | ||
return blockHeader; | ||
} | ||
|
||
public void setBlockHeader(BlockHeader blockHeader) { | ||
this.blockHeader = blockHeader; | ||
} | ||
|
||
public List<String> getTransactionsHashes() { | ||
return transactionsHashes; | ||
} | ||
|
||
public void setTransactionsHashes(List<String> transactionsHashes) { | ||
this.transactionsHashes = transactionsHashes; | ||
} | ||
|
||
public byte[] getRawBytes() { | ||
return rawBytes; | ||
} | ||
|
||
public void setRawBytes(byte[] rawBytes) { | ||
this.rawBytes = rawBytes; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Block{" | ||
+ "rawBytes=" | ||
+ Arrays.toString(rawBytes) | ||
+ ", blockHeader=" | ||
+ blockHeader | ||
+ ", transactionsHashes=" | ||
+ Arrays.toString(transactionsHashes.toArray()) | ||
+ '}'; | ||
} | ||
} |
81 changes: 81 additions & 0 deletions
81
src/main/java/com/webank/wecrosssdk/rpc/common/BlockHeader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package com.webank.wecrosssdk.rpc.common; | ||
|
||
public class BlockHeader { | ||
private long number; | ||
private String prevHash; | ||
private String hash; | ||
private String stateRoot; | ||
private String transactionRoot; | ||
private String receiptRoot; | ||
|
||
public long getNumber() { | ||
return number; | ||
} | ||
|
||
public void setNumber(long number) { | ||
this.number = number; | ||
} | ||
|
||
public String getPrevHash() { | ||
return prevHash; | ||
} | ||
|
||
public void setPrevHash(String prevHash) { | ||
this.prevHash = prevHash; | ||
} | ||
|
||
public String getHash() { | ||
return hash; | ||
} | ||
|
||
public void setHash(String hash) { | ||
this.hash = hash; | ||
} | ||
|
||
public String getStateRoot() { | ||
return stateRoot; | ||
} | ||
|
||
public void setStateRoot(String stateRoot) { | ||
this.stateRoot = stateRoot; | ||
} | ||
|
||
public String getTransactionRoot() { | ||
return transactionRoot; | ||
} | ||
|
||
public void setTransactionRoot(String transactionRoot) { | ||
this.transactionRoot = transactionRoot; | ||
} | ||
|
||
public String getReceiptRoot() { | ||
return receiptRoot; | ||
} | ||
|
||
public void setReceiptRoot(String receiptRoot) { | ||
this.receiptRoot = receiptRoot; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "BlockHeader{" | ||
+ "number=" | ||
+ number | ||
+ ", prevHash='" | ||
+ prevHash | ||
+ '\'' | ||
+ ", hash='" | ||
+ hash | ||
+ '\'' | ||
+ ", stateRoot='" | ||
+ stateRoot | ||
+ '\'' | ||
+ ", transactionRoot='" | ||
+ transactionRoot | ||
+ '\'' | ||
+ ", receiptRoot='" | ||
+ receiptRoot | ||
+ '\'' | ||
+ '}'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/main/java/com/webank/wecrosssdk/rpc/methods/request/BlockRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.webank.wecrosssdk.rpc.methods.request; | ||
|
||
import java.math.BigInteger; | ||
|
||
public class BlockRequest { | ||
private BigInteger blockNumber; | ||
private String path; | ||
|
||
public BlockRequest() {} | ||
|
||
public BlockRequest(BigInteger blockNumber, String path) { | ||
this.blockNumber = blockNumber; | ||
this.path = path; | ||
} | ||
|
||
public BigInteger getBlockNumber() { | ||
return blockNumber; | ||
} | ||
|
||
public void setBlockNumber(BigInteger blockNumber) { | ||
this.blockNumber = blockNumber; | ||
} | ||
|
||
public String getPath() { | ||
return path; | ||
} | ||
|
||
public void setPath(String path) { | ||
this.path = path; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/main/java/com/webank/wecrosssdk/rpc/methods/response/BlockResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.webank.wecrosssdk.rpc.methods.response; | ||
|
||
import com.webank.wecrosssdk.rpc.common.Block; | ||
import com.webank.wecrosssdk.rpc.methods.Response; | ||
|
||
public class BlockResponse extends Response<Block> { | ||
|
||
public BlockResponse() { | ||
super(); | ||
} | ||
|
||
public Block getBlock() { | ||
return getData(); | ||
} | ||
|
||
public void setBlock(Block block) { | ||
setData(block); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.