Esempio n. 1
0
    public void CallTransfer()
    {
        var gmol         = new GoodsModel();
        var serialNumber = Util.getRandomCode(32);

        SmartContracts.Call(gmol, "vote", inputQueryTransfer.text, (Util.OnNAS * 0.000001).ToString("F0"), new string[] { "霸王别姬" }, serialNumber);
        StartCoroutine(TransferStatusCoroutine(serialNumber));
    }
Esempio n. 2
0
        public void Switch(Networks network)
        {
            if (_smartContract != null)
            {
                _smartContract.Dispose();
                _smartContract = null;
            }

            _smartContract = _smartContractFactory.Build(network);
        }
Esempio n. 3
0
 public void GetTransactionReceipt()
 {
     this.StartCoroutine(
         SmartContracts.GetTransactionReceipt(inputQueryTransfer.text, (success) =>
     {
         Debug.Log(success);
     }, (fail) =>
     {
         Debug.LogError(fail);
     }));
 }
Esempio n. 4
0
 public void QueryTransferStatus()
 {
     this.StartCoroutine(
         SmartContracts.QueryTransferStatus(inputQueryTransfer.text, (success) =>
     {
         Debug.Log(success);
     }, (fail) =>
     {
         Debug.LogError(fail);
     }));
 }
Esempio n. 5
0
 public void SimulationCall()
 {
     this.StartCoroutine(
         SmartContracts.SimulationCall("n1NrqHkmuFAHsifysfBh6gombgeg6wJrfnB", "n1j2Q5E9SU1JnpqbyQLVRM8D2jPeefDXKau", "info", null, (success) =>
     {
         Debug.Log(success);
         TransferStatusHandler.Invoke(success);
     }, (fail) =>
     {
         Debug.LogError(fail);
         TransferStatusErrorHandler.Invoke(fail);
     })
         );
 }
Esempio n. 6
0
    public IEnumerator TransferStatusCoroutine(string serialNumber)
    {
        yield return(new WaitForSeconds(1));

        yield return(SmartContracts.QueryTransferStatus(serialNumber, (success) =>
        {
            Debug.Log(success);
            TransferStatusHandler.Invoke(success);
        }, (fail) =>
        {
            Debug.LogError(fail);
            TransferStatusErrorHandler.Invoke(fail);
        }));
    }
Esempio n. 7
0
        private void RemoveSmartContracts()
        {
            var assm = Assembly.LoadFrom("SimpleBlockChain.Core.dll");
            var path = Path.Combine(Path.GetDirectoryName(assm.Location), string.Format("db_{0}.dat", SmartContracts.GetDirectoryName(_network)));

            if (!Directory.Exists(path))
            {
                return;
            }

            Directory.Delete(path, true);
        }