From 6a337c8e49b2dcf9d6182a87ef251cc48ba87e03 Mon Sep 17 00:00:00 2001 From: eanzhao Date: Thu, 19 Dec 2024 17:41:11 +0800 Subject: [PATCH] add method SetParentChainHeight to cross chain contract. --- .../CrossChainContract.Hotfix.cs | 13 +++++++++++++ protobuf/cross_chain_contract.proto | 3 +++ 2 files changed, 16 insertions(+) create mode 100644 contract/AElf.Contracts.CrossChain/CrossChainContract.Hotfix.cs diff --git a/contract/AElf.Contracts.CrossChain/CrossChainContract.Hotfix.cs b/contract/AElf.Contracts.CrossChain/CrossChainContract.Hotfix.cs new file mode 100644 index 0000000000..7f7fde15eb --- /dev/null +++ b/contract/AElf.Contracts.CrossChain/CrossChainContract.Hotfix.cs @@ -0,0 +1,13 @@ +using Google.Protobuf.WellKnownTypes; + +namespace AElf.Contracts.CrossChain; + +public partial class CrossChainContract +{ + public override Empty SetParentChainHeight(Int64Value input) + { + AssertAddressIsCurrentMiner(Context.Sender); + State.CurrentParentChainHeight.Value = input.Value; + return new Empty(); + } +} \ No newline at end of file diff --git a/protobuf/cross_chain_contract.proto b/protobuf/cross_chain_contract.proto index ef0d9b55a6..8c6b4b8be7 100644 --- a/protobuf/cross_chain_contract.proto +++ b/protobuf/cross_chain_contract.proto @@ -65,6 +65,9 @@ service CrossChainContract { option (aelf.is_view) = true; } + rpc SetParentChainHeight (google.protobuf.Int64Value) returns (google.protobuf.Empty) { + } + // Get the chain id of parent chain. rpc GetParentChainId (google.protobuf.Empty) returns (google.protobuf.Int32Value) { option (aelf.is_view) = true;