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); }
private void SetTrust(SignedWeight trust, AgentId agentId, IEnumerable <IActor> actors) => actors.ToList().ForEach(actor => actor.Account.SetTrust(agentId, trust));
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))); }
public SignedWeight SetTrust(AgentId id, SignedWeight trust) => GetPeer(id).Trust = id == Id ? SignedWeight.Max : trust;