Exemplo n.º 1
0
        public void CreateFeed(Address owner, string name, FeedMode mode)
        {
            var Runtime = this;

            Runtime.Expect(Runtime.IsRootChain(), "must be root chain");

            var pow = Runtime.Transaction.Hash.GetDifficulty();

            Runtime.Expect(pow >= (int)ProofOfWork.Minimal, "expected proof of work");

            Runtime.Expect(!string.IsNullOrEmpty(name), "name required");

            Runtime.Expect(owner.IsUser, "owner address must be user address");
            Runtime.Expect(Runtime.IsStakeMaster(owner), "needs to be master");
            Runtime.Expect(Runtime.IsWitness(owner), "invalid witness");

            Runtime.Expect(Nexus.CreateFeed(RootStorage, owner, name, mode), "feed creation failed");

            Runtime.Notify(EventKind.FeedCreate, owner, name);
        }
Exemplo n.º 2
0
 public bool CreateFeed(Address owner, string name, FeedMode mode)
 {
     return(Nexus.CreateFeed(this.RootStorage, owner, name, mode));
 }