public SmartContractRunnerForCategoryZero(
     string sdkDir,
     IServiceContainer <IExecutivePlugin> executivePlugins = null,
     IEnumerable <string> blackList = null,
     IEnumerable <string> whiteList = null)
 {
     _sdkDir           = Path.GetFullPath(sdkDir);
     _sdkStreamManager = new SdkStreamManager(_sdkDir);
     _contractAuditor  = new ContractAuditor(blackList, whiteList);
     _executivePlugins = executivePlugins ?? ServiceContainerFactory <IExecutivePlugin> .Empty;
 }
Exemplo n.º 2
0
        public void ContractAuditor_Basic_Test()
        {
            var whiteList = new List <string>
            {
                "System.Collection",
                "System.Linq"
            };
            var blackList = new List <string>
            {
                "System.Random",
                "System.DateTime"
            };

            _auditor = new ContractAuditor(whiteList, blackList);

            Should.Throw <InvalidCodeException>(() => _auditor.Audit(_badContractCode, true));
        }