Skip to content

Commit

Permalink
[feat&fix][*][v0.1.2] downgrade fastjson to 1.2.83_noneautotype and…
Browse files Browse the repository at this point in the history
… 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`
  • Loading branch information
zouxyan authored Oct 7, 2023
1 parent 8f7362d commit 35dd03f
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 22 deletions.
4 changes: 2 additions & 2 deletions antchain-bridge-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.alipay.antchain.bridge</groupId>
<artifactId>antchain-bridge-commons</artifactId>
<version>0.1.1</version>
<version>0.1.2</version>

<properties>
<maven.compiler.source>8</maven.compiler.source>
Expand All @@ -25,7 +25,7 @@
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>2.0.21</version>
<version>1.2.83_noneautotype</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public static class ProvableLedgerData {
private byte[] ledgerData;

private byte[] proof;

private byte[] txHash;
}

public static CrossChainMessage createCrossChainMessage(
Expand All @@ -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);
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion antchain-bridge-plugin-lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.alipay.antchain.bridge</groupId>
<artifactId>antchain-bridge-plugin-lib</artifactId>
<version>0.1.1</version>
<version>0.1.2</version>

<properties>
<maven.compiler.source>8</maven.compiler.source>
Expand Down
6 changes: 3 additions & 3 deletions antchain-bridge-plugin-manager/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.alipay.antchain.bridge</groupId>
<artifactId>antchain-bridge-plugin-manager</artifactId>
<version>0.1.1</version>
<version>0.1.2</version>

<properties>
<maven.compiler.source>8</maven.compiler.source>
Expand All @@ -18,12 +18,12 @@
<dependency>
<groupId>com.alipay.antchain.bridge</groupId>
<artifactId>antchain-bridge-plugin-lib</artifactId>
<version>0.1.1</version>
<version>0.1.2</version>
</dependency>
<dependency>
<groupId>com.alipay.antchain.bridge</groupId>
<artifactId>antchain-bridge-spi</artifactId>
<version>0.1.1</version>
<version>0.1.2</version>
</dependency>

<dependency>
Expand Down
4 changes: 2 additions & 2 deletions antchain-bridge-spi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.alipay.antchain.bridge</groupId>
<artifactId>antchain-bridge-spi</artifactId>
<version>0.1.1</version>
<version>0.1.2</version>

<properties>
<maven.compiler.source>8</maven.compiler.source>
Expand All @@ -23,7 +23,7 @@
<dependency>
<groupId>com.alipay.antchain.bridge</groupId>
<artifactId>antchain-bridge-commons</artifactId>
<version>0.1.1</version>
<version>0.1.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
4 changes: 2 additions & 2 deletions pluginset/demo-testchain/offchain-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
<dependency>
<groupId>com.alipay.antchain.bridge</groupId>
<artifactId>antchain-bridge-plugin-lib</artifactId>
<version>0.1.1</version>
<version>0.1.2</version>
</dependency>
<dependency>
<groupId>com.alipay.antchain.bridge</groupId>
<artifactId>antchain-bridge-spi</artifactId>
<version>0.1.1</version>
<version>0.1.2</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ public List<CrossChainMessage> 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());
}
Expand Down
2 changes: 1 addition & 1 deletion pluginset/demo-testchain/plugin-loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<dependency>
<groupId>com.alipay.antchain.bridge</groupId>
<artifactId>antchain-bridge-plugin-manager</artifactId>
<version>0.1.1</version>
<version>0.1.2</version>
</dependency>

<!-- Logging -->
Expand Down
4 changes: 2 additions & 2 deletions pluginset/eos/offchain-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
<dependency>
<groupId>com.alipay.antchain.bridge</groupId>
<artifactId>antchain-bridge-plugin-lib</artifactId>
<version>0.1.1</version>
<version>0.1.2</version>
</dependency>
<dependency>
<groupId>com.alipay.antchain.bridge</groupId>
<artifactId>antchain-bridge-spi</artifactId>
<version>0.1.1</version>
<version>0.1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,8 @@ public List<CrossChainMessage> 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())
)
)
);
Expand Down
1 change: 0 additions & 1 deletion pluginset/eos/onchain-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
- Demo合约:这是一个Demo合约,实现了简单的消息接收、发送;

下面的图片介绍了合约之间的关系,主要他们之间的调用权限,在部署时添加这个权限。

<img src="https://antchainbridge.oss-cn-shanghai.aliyuncs.com/antchainbridge/document/picture/eos-contracts-arch.jpeg" style="zoom:50%;" />

## 部署AM合约
Expand Down
4 changes: 2 additions & 2 deletions pluginset/ethereum/offchain-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
<dependency>
<groupId>com.alipay.antchain.bridge</groupId>
<artifactId>antchain-bridge-plugin-lib</artifactId>
<version>0.1.1</version>
<version>0.1.2</version>
</dependency>
<dependency>
<groupId>com.alipay.antchain.bridge</groupId>
<artifactId>antchain-bridge-spi</artifactId>
<version>0.1.1</version>
<version>0.1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ public List<CrossChainMessage> 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()));
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/print.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 35dd03f

Please sign in to comment.