コード例 #1
0
ファイル: DeployContract.cs プロジェクト: LAToken/lachain
        public ExecutionStatus GetDeployHeight(UInt160 contractAddress, SystemContractExecutionFrame frame)
        {
            frame.ReturnValue = new byte[64];
            try
            {
                if (HardforkHeights.IsHardfork_3Active(frame.InvocationContext.Snapshot.Blocks.GetTotalBlockHeight()))
                {
                    if (HardforkHeights.IsHardfork_6Active(
                            frame.InvocationContext.Snapshot.Blocks.GetTotalBlockHeight()))
                    {
                        frame.ReturnValue = _deployHeight.GetValue(contractAddress.ToBytes()) ?? new byte[64];
                    }
                    else
                    {
                        frame.ReturnValue = _deployHeight.GetValue(contractAddress.ToBytes());
                    }
                }
            }
            catch (Exception e)
            {
                Logger.LogInformation($"Exception while get deploy height: {e}");
            }

            return(ExecutionStatus.Ok);
        }