コード例 #1
0
        /// <summary>
        /// Called every time the customer wants to pay for something
        /// </summary>
        public void CreateMoneyOrders(decimal amount)
        {
            Amount      = amount;
            MoneyOrders = new List <MoneyOrder>();

            // for testing only
            var rnd = new Random();

            // for testing only

            for (var i = 0; i < NumOrders; i++)
            {
                var testBytes = new byte[10];
                rnd.NextBytes(testBytes);
                var uniquenessString = new Guid();
                //var idPairs = CreateIdStringPairs(PersonalDataBytes);
                // TODO: once done testing, change back to use our personal data
                var idPairs           = CreateIdStringPairs(testBytes);
                var currentMoneyOrder = new MoneyOrder(Amount, uniquenessString.ToByteArray(), idPairs);
                MoneyOrders.Add(currentMoneyOrder);
            }

            // store the transaction for later reference with a unique id
            Ledger.Add(new Guid(), MoneyOrders);
        }
コード例 #2
0
ファイル: Alice.cs プロジェクト: 0culus/ElectronicCash
        /// <summary>
        /// Called every time the customer wants to pay for something
        /// </summary>
        public void CreateMoneyOrders(decimal amount)
        {
            Amount = amount;
            MoneyOrders = new List<MoneyOrder>();

            // for testing only
            var rnd = new Random();
            // for testing only

            for (var i = 0; i < NumOrders; i++)
            {
                var testBytes = new byte[10];
                rnd.NextBytes(testBytes);
                var uniquenessString = new Guid();
                //var idPairs = CreateIdStringPairs(PersonalDataBytes);
                // TODO: once done testing, change back to use our personal data
                var idPairs = CreateIdStringPairs(testBytes);
                var currentMoneyOrder = new MoneyOrder(Amount, uniquenessString.ToByteArray(), idPairs);
                MoneyOrders.Add(currentMoneyOrder);
            }

            // store the transaction for later reference with a unique id
            Ledger.Add(new Guid(), MoneyOrders);
        }