Beispiel #1
0
        public static ByteString ExtractCrossChainExtraDataFromCrossChainBlockData(this CrossChainBlockData crossChainBlockData)
        {
            if (crossChainBlockData.IsNullOrEmpty() || crossChainBlockData.SideChainBlockDataList.Count == 0)
            {
                return(ByteString.Empty);
            }

            var indexedSideChainBlockData = new IndexedSideChainBlockData
            {
                SideChainBlockDataList = { crossChainBlockData.SideChainBlockDataList }
            };

            return(indexedSideChainBlockData.ExtractCrossChainExtraDataFromCrossChainBlockData());
        }
Beispiel #2
0
        private bool ValidateBlockExtraDataAsync(IndexedSideChainBlockData indexedSideChainBlockData, ByteString extraData)
        {
            var expected = indexedSideChainBlockData.ExtractCrossChainExtraDataFromCrossChainBlockData();

            return(expected.Equals(extraData));
        }