コード例 #1
0
        public OperationManagerTest()
        {
            _login = new Dictionary <string, string>()
            {
                { "Steem", "Test Login" },
                { "Golos", Constants.GolosUser }
            };
            _userPrivateKeys = new Dictionary <string, List <byte[]> >()
            {
                { "Steem", new List <byte[]> {
                      Base58.GetBytes(Constants.SteemPostingKey)
                  } },
                { "Golos", new List <byte[]> {
                      Base58.GetBytes(Constants.GolosPostingKey)
                  } }
            };
            _chain = new Dictionary <string, ChainInfo>();

            var steemChainInfo = ChainManager.GetChainInfo(KnownChains.Steem);

            _chain.Add("Steem", steemChainInfo);
            _steem = new OperationManager(steemChainInfo.Url, steemChainInfo.ChainId);

            var golosChainInfo = ChainManager.GetChainInfo(KnownChains.Golos);

            _chain.Add("Golos", golosChainInfo);
            _golos = new OperationManager(golosChainInfo.Url, golosChainInfo.ChainId);
        }
コード例 #2
0
        public void FollowOperation()
        {
            Login = new Dictionary <string, string>()
            {
                { "Steem", txtUsername.Text }
            };

            UserPrivateKeys = new Dictionary <string, List <byte[]> >()
            {
                { "Steem", new List <byte[]> {
                      Base58.GetBytes(txtPassword.Text)
                  } }
            };

            Chain = new Dictionary <string, ChainInfo>();

            var steemChainInfo = ChainManager.GetChainInfo(KnownChains.Steem);

            Chain.Add("Steem", steemChainInfo);
            Steem = new OperationManager(steemChainInfo.Url, steemChainInfo.ChainId);


            var op    = new UnFollowOperation(txtUsername.Text, txtFollower.Text, FollowType.blog, txtUsername.Text);
            var prop  = Manager("Steem").VerifyAuthority(UserPrivateKeys["Steem"], op);
            var propa = Manager("Steem").BroadcastOperations(UserPrivateKeys["Steem"], op);

            if (propa.Error == null)
            {
                lblStatus.Text = "Follow user '" + txtFollower.Text + "' transaction successfully completed!";
            }
            else
            {
                lblStatus.Text = "Error follow user: " + propa.Error.Message.ToString();
            }
        }
コード例 #3
0
ファイル: BaseTest.cs プロジェクト: ssshuler/Ditch
        public BaseTest()
        {
            Login = new Dictionary <string, string>()
            {
                { "Steem", "UserLogin" },
                { "Golos", "UserLogin" }
            };

            UserPrivateKeys = new Dictionary <string, List <byte[]> >()
            {
                { "Steem", new List <byte[]> {
                      Base58.TryGetBytes("5**************************************************")
                  } },
                { "Golos", new List <byte[]> {
                      Base58.TryGetBytes("5**************************************************")
                  } }
            };

            Chain = new Dictionary <string, ChainInfo>();

            var steemChainInfo = ChainManager.GetChainInfo(KnownChains.Steem);

            Chain.Add("Steem", steemChainInfo);
            Steem = new OperationManager(steemChainInfo.Url, steemChainInfo.ChainId);

            var golosChainInfo = ChainManager.GetChainInfo(KnownChains.Golos);

            Chain.Add("Golos", golosChainInfo);
            Golos = new OperationManager(golosChainInfo.Url, golosChainInfo.ChainId);
        }
コード例 #4
0
        public void PostDataToSteemWithUpvote()
        {
            Login = new Dictionary <string, string>()
            {
                { "Steem", txtUsername.Text }
            };

            UserPrivateKeys = new Dictionary <string, List <byte[]> >()
            {
                { "Steem", new List <byte[]> {
                      Base58.GetBytes(txtPassword.Text)
                  } }
            };

            Chain = new Dictionary <string, ChainInfo>();

            var steemChainInfo = ChainManager.GetChainInfo(KnownChains.Steem);

            Chain.Add("Steem", steemChainInfo);
            Steem = new OperationManager(steemChainInfo.Url, steemChainInfo.ChainId);

            var op    = new PostOperation(txtTag1.Text, txtUsername.Text, txtTitle.Text, txtResponse.Text, "{\"app\": \"steemit/0.1\", \"tags\": [\"" + txtTag2.Text + "\",\"" + txtTag3.Text + "\",\"" + txtTag4.Text + "\",\"" + txtTag5.Text + "\"]}");
            var prop  = Manager("Steem").VerifyAuthority(UserPrivateKeys["Steem"], op);
            var propa = Manager("Steem").BroadcastOperations(UserPrivateKeys["Steem"], op);

            if (propa.Error == null)
            {
                lblStatus.Text = "'Post to STEEM' transaction successfully completed!";

                var up     = new UpVoteOperation(txtUsername.Text, txtUsername.Text, op.Permlink);
                var uprop  = Manager("Steem").VerifyAuthority(UserPrivateKeys["Steem"], up);
                var upropa = Manager("Steem").BroadcastOperations(UserPrivateKeys["Steem"], up);
            }
            else
            {
                lblStatus.Text = "Error posting on STEEM: " + propa.Error.Message.ToString();
            }
        }
コード例 #5
0
        public void PostDataToSteem()
        {
            Login = new Dictionary <string, string>()
            {
                { "Steem", txtUsername.Text }
            };

            UserPrivateKeys = new Dictionary <string, List <byte[]> >()
            {
                { "Steem", new List <byte[]> {
                      Base58.GetBytes(txtPassword.Text)
                  } }
            };

            Chain = new Dictionary <string, ChainInfo>();

            var steemChainInfo = ChainManager.GetChainInfo(KnownChains.Steem);

            Chain.Add("Steem", steemChainInfo);
            Steem = new OperationManager(steemChainInfo.Url, steemChainInfo.ChainId);

            var op   = new PostOperation(txtTag1.Text, txtUsername.Text, txtTitle.Text, txtResponse.Text, "{\"app\": \"steemit/0.1\", \"tags\": [\"" + txtTag2.Text + "\",\"" + txtTag3.Text + "\",\"" + txtTag4.Text + "\",\"" + txtTag5.Text + "\"]}");
            var prop = Manager("Steem").VerifyAuthority(UserPrivateKeys["Steem"], op);
            var resp = Manager("Steem").GetAccountBandwidth(txtUsername.Text, BandwidthType.Post);
            var Text = JsonConvert.SerializeObject(resp.Result);

            var propa = Manager("Steem").BroadcastOperations(UserPrivateKeys["Steem"], op);

            if (propa.Error == null)
            {
                lblStatus.Text = "Posted to STEEM blockchain, finished";
            }
            else
            {
                lblStatus.Text = propa.Error.Message.ToString();
            }
        }