public void CreateFeed(Address owner, string name, OracleFeedMode mode) { 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(IsWitness(owner), "invalid witness"); Runtime.Expect(owner.IsUser, "owner address must be user address"); Runtime.Expect(Runtime.Nexus.CreateFeed(owner, name, mode), "feed creation failed"); Runtime.Notify(EventKind.FeedCreate, owner, name); }
public void UnserializeData(BinaryReader reader) { Name = reader.ReadVarString(); Address = reader.ReadAddress(); Mode = (OracleFeedMode)reader.ReadByte(); }
public OracleFeed(string name, Address address, OracleFeedMode mode) { Name = name; Address = address; Mode = mode; }