Пример #1
0
        public byte[] CreateSideChain(Hash chainId, Address lockedAddress, ulong lockedToken)
        {
            ulong serialNumber = _sideChainSerialNumber.Increment().Value;
            var   info         = new SideChainInfo
            {
                Owner          = Api.GetTransaction().From,
                ChainId        = chainId,
                SerialNumer    = serialNumber,
                Status         = SideChainStatus.Pending,
                LockedAddress  = lockedAddress,
                LockedToken    = lockedToken,
                CreationHeight = Api.GetCurerntHeight() + 1
            };

            _sideChainInfos[chainId] = info;
            new SideChainCreationRequested()
            {
                ChainId = chainId,
                Creator = Api.GetTransaction().From
            }.Fire();
            return(chainId.DumpByteArray());
        }