Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Counter.Coin = 0;
            Counter.Signature = 0;
            Counter.Transaction = 0;

            var goofy = new Goofy(256);
            var alice = new Person(256);
            var bob = new Person(256);
            var clark = new Person(256);

            //goofy transaction
            var goofyTrans = goofy.CreateCoin(alice.PublicKey);

            //alice transaction
            alice.AddTransaction(goofyTrans);
            var aliceTrans = alice.PayTo(bob.PublicKey);

            //bob transaction
            bob.AddTransaction(aliceTrans);
            var bobTrans = bob.PayTo(clark.PublicKey);

            //clark transaction
            clark.AddTransaction(bobTrans);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            var goofy = new Authority();
            var alice = new Person();
            var bob = new Person();
            var clark = new Person();
            var david = new Signature(256);

            var coin = goofy.CreateCoin(alice.PublicKey);

            var trans1 = alice.PayTo(coin, bob.PublicKey);

            var trans2 = bob.PayTo(coin, clark.PublicKey);

            var trans3 = clark.PayTo(coin, david.PublicKey);

            var b = trans3.Previous.isValidHash();
        }