예제 #1
0
        public async Task UpdateContractAsync(Address contractAddress,
                                              SmartContractRegistration newRegistration, bool isPrivileged, Hash name)
        {
            // get runner
            var runner = _smartContractRunnerContainer.GetRunner(newRegistration.Category);
            await Task.Run(() => runner.CodeCheck(newRegistration.Code.ToByteArray(), isPrivileged));

            _smartContractExecutiveService.ClearExecutivePool(contractAddress);

            //Todo New version metadata handle it
//            var oldRegistration = await GetContractByAddressAsync(contractAddress);
//            var oldContractType = runner.GetContractType(oldRegistration);
//            var oldContractTemplate = runner.ExtractMetadata(oldContractType);
//
//            var newContractType = runner.GetContractType(newRegistration);
//            var newContractTemplate = runner.ExtractMetadata(newContractType);
//            await _functionMetadataService.UpdateContract(contractAddress, newContractTemplate,
//                oldContractTemplate);
        }