Example #1
0
 public DemoGameRandomService(DemoGameConfig config, IRandomNumberGenerator random, IGenericDataStorage storage, ICryptoService cryptoService, IKeySecretManager keySecretManager)
 {
     this.random        = random;
     this.storage       = storage;
     this.cryptoService = cryptoService;
     this.keySecret     = keySecretManager.LoadKeySecret(config.PrivateKey);
 }
 public BuildinRandomContributorService(RandomContributorConfig config, IRandomNumberGenerator random, IGenericDataStorage storage, ICryptoService cryptoService, IKeySecretManager keySecretManager)
 {
     this.random        = random;
     this.storage       = storage;
     this.cryptoService = cryptoService;
     this.keySecret     = keySecretManager.LoadKeySecret(config.PrivateKey);
 }
Example #3
0
 public DemoProtocolService(ChaosProtocolConfig config, IRandomNumberGenerator random, IGenericDataStorage storage, ICryptoService cryptoService, IKeySecretManager keySecretManager, IpfsFileStorageService ipfs)
 {
     this.random        = random;
     this.storage       = storage;
     this.cryptoService = cryptoService;
     this.ipfs          = ipfs;
     this.keySecret     = keySecretManager.LoadKeySecret(config.ApiSecret);
 }
        public static bool TryLoad <T>(this IGenericDataStorage <T> storage, string key, out T value, T defaultValue)
        {
            if (storage.Has(key))
            {
                value = storage.Load(key);
                return(true);
            }

            value = defaultValue;
            return(false);
        }