From 35dd03f0ff5dc2b542d9cb6caadd292a4dca8d14 Mon Sep 17 00:00:00 2001 From: zouxyan Date: Fri, 6 Oct 2023 23:04:13 -0500 Subject: [PATCH] [feat&fix][*][v0.1.2] downgrade fastjson to `1.2.83_noneautotype` and add `txHash` to `CrossChainReceipt` (#17) * [feat][*][0.1.4]: add txHash to CrossChainMessage * [feat][*][0.1.4]: update version to 0.1.2 * [fix][common][v0.1.2] downgrade fastjson to `1.2.83_noneautotype` --- antchain-bridge-commons/pom.xml | 4 ++-- .../bridge/commons/core/base/CrossChainMessage.java | 6 +++++- antchain-bridge-plugin-lib/pom.xml | 2 +- antchain-bridge-plugin-manager/pom.xml | 6 +++--- antchain-bridge-spi/pom.xml | 4 ++-- pluginset/demo-testchain/offchain-plugin/pom.xml | 4 ++-- .../bridge/plugins/demo/testchain/MockDataUtils.java | 3 ++- .../bridge/plugins/demo/testchain/TestChainBBCService.java | 3 ++- pluginset/demo-testchain/plugin-loader/pom.xml | 2 +- pluginset/eos/offchain-plugin/pom.xml | 4 ++-- .../alipay/antchain/bridge/plugins/eos/EosBBCService.java | 3 ++- pluginset/eos/onchain-plugin/README.md | 1 - pluginset/ethereum/offchain-plugin/pom.xml | 4 ++-- .../bridge/plugins/ethereum/EthereumBBCService.java | 3 ++- scripts/print.sh | 2 +- 15 files changed, 29 insertions(+), 22 deletions(-) diff --git a/antchain-bridge-commons/pom.xml b/antchain-bridge-commons/pom.xml index 424d755d..f3ea0e80 100644 --- a/antchain-bridge-commons/pom.xml +++ b/antchain-bridge-commons/pom.xml @@ -6,7 +6,7 @@ com.alipay.antchain.bridge antchain-bridge-commons - 0.1.1 + 0.1.2 8 @@ -25,7 +25,7 @@ com.alibaba fastjson - 2.0.21 + 1.2.83_noneautotype cn.hutool diff --git a/antchain-bridge-commons/src/main/java/com/alipay/antchain/bridge/commons/core/base/CrossChainMessage.java b/antchain-bridge-commons/src/main/java/com/alipay/antchain/bridge/commons/core/base/CrossChainMessage.java index ef1b803a..6f54b78c 100644 --- a/antchain-bridge-commons/src/main/java/com/alipay/antchain/bridge/commons/core/base/CrossChainMessage.java +++ b/antchain-bridge-commons/src/main/java/com/alipay/antchain/bridge/commons/core/base/CrossChainMessage.java @@ -55,6 +55,8 @@ public static class ProvableLedgerData { private byte[] ledgerData; private byte[] proof; + + private byte[] txHash; } public static CrossChainMessage createCrossChainMessage( @@ -64,7 +66,8 @@ public static CrossChainMessage createCrossChainMessage( byte[] blockHash, byte[] message, byte[] ledgerData, - byte[] proof + byte[] proof, + byte[] txHash ) { CrossChainMessage msg = new CrossChainMessage(); msg.setType(type); @@ -75,6 +78,7 @@ public static CrossChainMessage createCrossChainMessage( provableLedgerData.setBlockHash(blockHash); provableLedgerData.setHeight(height); provableLedgerData.setTimestamp(timestamp); + provableLedgerData.setTxHash(txHash); msg.setProvableData(provableLedgerData); return msg; diff --git a/antchain-bridge-plugin-lib/pom.xml b/antchain-bridge-plugin-lib/pom.xml index 9c7de589..5119ac54 100644 --- a/antchain-bridge-plugin-lib/pom.xml +++ b/antchain-bridge-plugin-lib/pom.xml @@ -6,7 +6,7 @@ com.alipay.antchain.bridge antchain-bridge-plugin-lib - 0.1.1 + 0.1.2 8 diff --git a/antchain-bridge-plugin-manager/pom.xml b/antchain-bridge-plugin-manager/pom.xml index be680977..c42173ce 100644 --- a/antchain-bridge-plugin-manager/pom.xml +++ b/antchain-bridge-plugin-manager/pom.xml @@ -6,7 +6,7 @@ com.alipay.antchain.bridge antchain-bridge-plugin-manager - 0.1.1 + 0.1.2 8 @@ -18,12 +18,12 @@ com.alipay.antchain.bridge antchain-bridge-plugin-lib - 0.1.1 + 0.1.2 com.alipay.antchain.bridge antchain-bridge-spi - 0.1.1 + 0.1.2 diff --git a/antchain-bridge-spi/pom.xml b/antchain-bridge-spi/pom.xml index 0c06db4a..b60f30bf 100644 --- a/antchain-bridge-spi/pom.xml +++ b/antchain-bridge-spi/pom.xml @@ -6,7 +6,7 @@ com.alipay.antchain.bridge antchain-bridge-spi - 0.1.1 + 0.1.2 8 @@ -23,7 +23,7 @@ com.alipay.antchain.bridge antchain-bridge-commons - 0.1.1 + 0.1.2 junit diff --git a/pluginset/demo-testchain/offchain-plugin/pom.xml b/pluginset/demo-testchain/offchain-plugin/pom.xml index 9bc5eea7..94685db6 100644 --- a/pluginset/demo-testchain/offchain-plugin/pom.xml +++ b/pluginset/demo-testchain/offchain-plugin/pom.xml @@ -27,12 +27,12 @@ com.alipay.antchain.bridge antchain-bridge-plugin-lib - 0.1.1 + 0.1.2 com.alipay.antchain.bridge antchain-bridge-spi - 0.1.1 + 0.1.2 provided diff --git a/pluginset/demo-testchain/offchain-plugin/src/main/java/com/alipay/antchain/bridge/plugins/demo/testchain/MockDataUtils.java b/pluginset/demo-testchain/offchain-plugin/src/main/java/com/alipay/antchain/bridge/plugins/demo/testchain/MockDataUtils.java index 6821663e..bb33c74e 100644 --- a/pluginset/demo-testchain/offchain-plugin/src/main/java/com/alipay/antchain/bridge/plugins/demo/testchain/MockDataUtils.java +++ b/pluginset/demo-testchain/offchain-plugin/src/main/java/com/alipay/antchain/bridge/plugins/demo/testchain/MockDataUtils.java @@ -50,7 +50,8 @@ public static CrossChainMessage generateCCMsg(Long height, byte[] ledgerData, by DigestUtil.sha256(height.toString()), generateAM().encode(), ledgerData, - proof + proof, + DigestUtil.sha256(height.toString()) ); } } diff --git a/pluginset/demo-testchain/offchain-plugin/src/main/java/com/alipay/antchain/bridge/plugins/demo/testchain/TestChainBBCService.java b/pluginset/demo-testchain/offchain-plugin/src/main/java/com/alipay/antchain/bridge/plugins/demo/testchain/TestChainBBCService.java index 5c578eb8..2991870d 100644 --- a/pluginset/demo-testchain/offchain-plugin/src/main/java/com/alipay/antchain/bridge/plugins/demo/testchain/TestChainBBCService.java +++ b/pluginset/demo-testchain/offchain-plugin/src/main/java/com/alipay/antchain/bridge/plugins/demo/testchain/TestChainBBCService.java @@ -169,7 +169,8 @@ public List readCrossChainMessagesByHeight(long l) { // put the ledger data inside, just for SPV or other attestations testChainReceipt.toBytes(), // this time we need no proof data. it's ok to set it with empty bytes - "pretend that we have merkle proof or some stuff".getBytes() + "pretend that we have merkle proof or some stuff".getBytes(), + testChainReceipt.getTxhash().getBytes() ) ).collect(Collectors.toList()); } diff --git a/pluginset/demo-testchain/plugin-loader/pom.xml b/pluginset/demo-testchain/plugin-loader/pom.xml index 456b1e83..704db6d0 100644 --- a/pluginset/demo-testchain/plugin-loader/pom.xml +++ b/pluginset/demo-testchain/plugin-loader/pom.xml @@ -17,7 +17,7 @@ com.alipay.antchain.bridge antchain-bridge-plugin-manager - 0.1.1 + 0.1.2 diff --git a/pluginset/eos/offchain-plugin/pom.xml b/pluginset/eos/offchain-plugin/pom.xml index 7e1a0653..f418f0c3 100644 --- a/pluginset/eos/offchain-plugin/pom.xml +++ b/pluginset/eos/offchain-plugin/pom.xml @@ -32,12 +32,12 @@ com.alipay.antchain.bridge antchain-bridge-plugin-lib - 0.1.1 + 0.1.2 com.alipay.antchain.bridge antchain-bridge-spi - 0.1.1 + 0.1.2 provided diff --git a/pluginset/eos/offchain-plugin/src/main/java/com/alipay/antchain/bridge/plugins/eos/EosBBCService.java b/pluginset/eos/offchain-plugin/src/main/java/com/alipay/antchain/bridge/plugins/eos/EosBBCService.java index aa867897..bfd23799 100644 --- a/pluginset/eos/offchain-plugin/src/main/java/com/alipay/antchain/bridge/plugins/eos/EosBBCService.java +++ b/pluginset/eos/offchain-plugin/src/main/java/com/alipay/antchain/bridge/plugins/eos/EosBBCService.java @@ -440,7 +440,8 @@ public List readCrossChainMessagesByHeight(long height) { // this time we need no verify. it's ok to set it with empty bytes new byte[]{}, // this time we need no proof data. it's ok to set it with empty bytes - new byte[]{} + new byte[]{}, + HexUtil.decodeHex(eosTxActions.getTxId()) ) ) ); diff --git a/pluginset/eos/onchain-plugin/README.md b/pluginset/eos/onchain-plugin/README.md index cf237dc6..b451787d 100644 --- a/pluginset/eos/onchain-plugin/README.md +++ b/pluginset/eos/onchain-plugin/README.md @@ -14,7 +14,6 @@ - Demo合约:这是一个Demo合约,实现了简单的消息接收、发送; 下面的图片介绍了合约之间的关系,主要他们之间的调用权限,在部署时添加这个权限。 - ## 部署AM合约 diff --git a/pluginset/ethereum/offchain-plugin/pom.xml b/pluginset/ethereum/offchain-plugin/pom.xml index 74a88e5d..74543171 100644 --- a/pluginset/ethereum/offchain-plugin/pom.xml +++ b/pluginset/ethereum/offchain-plugin/pom.xml @@ -27,12 +27,12 @@ com.alipay.antchain.bridge antchain-bridge-plugin-lib - 0.1.1 + 0.1.2 com.alipay.antchain.bridge antchain-bridge-spi - 0.1.1 + 0.1.2 provided diff --git a/pluginset/ethereum/offchain-plugin/src/main/java/com/alipay/antchain/bridge/plugins/ethereum/EthereumBBCService.java b/pluginset/ethereum/offchain-plugin/src/main/java/com/alipay/antchain/bridge/plugins/ethereum/EthereumBBCService.java index eb5d070d..fe10837e 100644 --- a/pluginset/ethereum/offchain-plugin/src/main/java/com/alipay/antchain/bridge/plugins/ethereum/EthereumBBCService.java +++ b/pluginset/ethereum/offchain-plugin/src/main/java/com/alipay/antchain/bridge/plugins/ethereum/EthereumBBCService.java @@ -232,7 +232,8 @@ public List readCrossChainMessagesByHeight(long height) { // todo: put ledger data, for SPV or other attestations "this time we need no verify. it's ok to set it with empty bytes".getBytes(), // todo: put proof data - "this time we need no proof data. it's ok to set it with empty bytes".getBytes() + "this time we need no proof data. it's ok to set it with empty bytes".getBytes(), + HexUtil.decodeHex(logObject.getTransactionHash()) ) ).collect(Collectors.toList())); } diff --git a/scripts/print.sh b/scripts/print.sh index 057801fb..4e368737 100755 --- a/scripts/print.sh +++ b/scripts/print.sh @@ -6,7 +6,7 @@ WHITE='\033[1;37m' NC='\033[0m' LIGHT_GRAY='\033[0;37m' -SDK_VERSION='0.1.1' +SDK_VERSION='0.1.2' function print_blue() { printf "${BLUE}%s${NC}\n" "$1"