예제 #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);
         }
     }
 }
예제 #2
0
        public void ExplicitCastFromFloat(float value, float expected)
        {
            var sw = new SignedWeight(expected);

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

            Assert.Equal(expected, sw);
        }
예제 #4
0
 private void SetTrust(SignedWeight trust, AgentId agentId, IEnumerable <IActor> actors)
 => actors.ToList().ForEach(actor => actor.Account.SetTrust(agentId, trust));
예제 #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)));
        }
예제 #6
0
 public SignedWeight SetTrust(AgentId id, SignedWeight trust)
 => GetPeer(id).Trust = id == Id ? SignedWeight.Max : trust;