Exemple #1
0
        public void BuildTokenUnfreezeMessageTest()
        {
            Wallet w = new Wallet("1E5B4C6DDDB2BDD6B40344808812D6D3254D7D4E105A52BA51C032EB7BAC1035", Network.Test);

            w.SetSequence(0);//Have to reset, wallet automatically refreshes it's sequence on creation
            var msgBytes    = BroadcastMessageBuilder.BuildTokenUnfreezeMessage("BNB", (decimal)0.1, w);
            var msgStr      = BitConverter.ToString(msgBytes).Replace("-", "").ToUpper();
            var expectedStr = "9A01F0625DEE0A246515FF0D0A141B0A2CFFAE1193EE0BDE3E01C62E34D82E3BFA0A1203424E421880ADE204126E0A26EB5AE9872103D2B6A5194D34703971E6C7544B2E5CE687AF7CF58346F662936D8E26C20A301312404F385A8F66A8E6656D4BF31034F107AE80720624EE46B9AAC0F50177AC8B5658149C9DE45872B2B008C81EEDC448DEA87A6BE351CADD77942E77F97E3FBD25A618ECE028";

            Assert.AreEqual(msgStr, expectedStr);
        }
Exemple #2
0
 public BroadcastResponse UnfreezeToken(string coin, decimal amount)
 {
     //Ensure no other broadcast transaction interferes with sequence until it hit the blockchain
     lock (BroadcastLockObject)
     {
         if (VerifySequenceBeforeSend)
         {
             Wallet.RefreshSequence();
         }
         var msg    = BroadcastMessageBuilder.BuildTokenUnfreezeMessage(coin, amount, Wallet);
         var result = HTTP.BroadcastToBlockchain(msg, WaitForTransactionConfirmationOnBroadcast);
         if (result.ok)
         {
             _wallet.IncrementSequence();
         }
         return(result);
     }
 }