Exemple #1
0
 protected void Interconnect(SignedWeight initialTrust, params IActor[] actors)
 {
     Interconnect(actors);
     foreach (var subject in actors)
     {
         foreach (var target in actors)
         {
             subject.Account.SetTrust(target.Account.Id, initialTrust);
         }
     }
 }
        public void ExplicitCastFromFloat(float value, float expected)
        {
            var sw = new SignedWeight(expected);

            Assert.Equal(sw, (SignedWeight)value);
        }
        public void ImplicitCastToFloat(float sweight, float expected)
        {
            var sw = new SignedWeight(sweight);

            Assert.Equal(expected, sw);
        }
Exemple #4
0
 private void SetTrust(SignedWeight trust, AgentId agentId, IEnumerable <IActor> actors)
 => actors.ToList().ForEach(actor => actor.Account.SetTrust(agentId, trust));
Exemple #5
0
        protected void SetMutualTrust(SignedWeight trust, params IActor[] actors)
        {
            var agentIds = actors.Select(actor => actor.Account.Id).ToList();

            agentIds.ForEach(id => SetTrust(trust, id, actors.Where(acc => acc.Account.Id != id)));
        }
Exemple #6
0
 public SignedWeight SetTrust(AgentId id, SignedWeight trust)
 => GetPeer(id).Trust = id == Id ? SignedWeight.Max : trust;