Пример #1
0
        public override SideChainIndexingInformationList GetSideChainIndexingInformationList(Empty input)
        {
            var sideChainIndexingInformationList = new SideChainIndexingInformationList();
            var sideChainIdAndHeightDict         = GetSideChainIdAndHeight(new Empty());

            foreach (var kv in sideChainIdAndHeightDict.IdHeightDict)
            {
                var chainId = kv.Key;
                sideChainIndexingInformationList.IndexingInformationList.Add(new SideChainIndexingInformation
                {
                    ChainId       = chainId,
                    IndexedHeight = kv.Value
                });
            }

            return(sideChainIndexingInformationList);
        }
Пример #2
0
        public override SideChainIndexingInformationList GetSideChainIndexingInformationList(Empty input)
        {
            var sideChainIndexingInformationList = new SideChainIndexingInformationList();
            var sideChainIdAndHeightDict         = GetSideChainIdAndHeight(new Empty());

            foreach (var kv in sideChainIdAndHeightDict.IdHeightDict)
            {
                int chainId          = kv.Key;
                var balance          = State.IndexingBalance[chainId];
                var sideChainInfo    = State.SideChainInfo[chainId];
                var toBeIndexedCount = balance.Div(sideChainInfo.SideChainCreationRequest.IndexingPrice);
                sideChainIndexingInformationList.IndexingInformationList.Add(new SideChainIndexingInformation
                {
                    ChainId          = chainId,
                    IndexedHeight    = kv.Value,
                    ToBeIndexedCount = toBeIndexedCount
                });
            }

            return(sideChainIndexingInformationList);
        }