Ejemplo n.º 1
0
        public string GenVerifyTransactionInfo(MerkleItem merkle)
        {
            string parameterinfo = "{\"from\":\"" + Account +
                                   "\",\"to\":\"" + SideChainTxId +
                                   "\",\"method\":\"VerifyTransaction\",\"incr\":\"" +
                                   GetCurrentTimeStamp() + "\",\"params\":[\"" + merkle.TxId + "\",\"" + merkle.MPath +
                                   "\",\"" + merkle.PHeight + "\"]}";
            var ci = new CommandInfo("broadcast_tx");

            ci.Parameter = parameterinfo;
            string requestInfo = CH.RpcGenerateTransactionRawTx(ci);

            return(requestInfo);
        }
Ejemplo n.º 2
0
        public MerkleItem GetMerkelPath(string txId)
        {
            MerkleItem merkle = new MerkleItem();

            merkle.TxId = txId;
            var ci = new CommandInfo("get_merkle_path");

            ci.Parameter = txId;
            CH.RpcGetMerklePath(ci);
            Assert.IsTrue(ci.Result, "Get merkel path got exception.");
            ci.GetJsonInfo();
            merkle.MPath   = ci.JsonInfo["result"]["merkle_path"].ToString();
            merkle.PHeight = ci.JsonInfo["result"].Value <Int32>("parent_height");

            return(merkle);
        }