예제 #1
0
        public void TestContractCallHash()
        {
            var acc = NebAccount.FromAddress("n1LfrjZzXDCcHhNV2r6F6dUS5Zxi7P8xC45");

            var contract = new NebContract
            {
                Content = new NebContract.CallContent
                {
                    Function = "js",
                    Args     = new object[] { "naosgnoa" }
                }
            };

            var transaction = new NebTransaction(1, acc, acc, "1", 1, "1000", "1000", contract);

            Assert.AreEqual("41926966d7b4c2a1fb27669346e5f73a0b78304237d8b92bd63d13882b9b4138",
                            ToHexString(transaction.GetTransactionHash()));
        }
예제 #2
0
        public void TestContractDeployHash()
        {
            var acc = NebAccount.FromAddress("n1LfrjZzXDCcHhNV2r6F6dUS5Zxi7P8xC45");

            var contract = new NebContract
            {
                Content = new NebContract.DeployContent
                {
                    SourceType = NebContract.DeployContent.ContentSourceType.Js,
                    Source     = "naosgnoa"
                }
            };

            var transaction = new NebTransaction(1, acc, acc, "1", 1, "1000", "1000", contract);

            Assert.AreEqual("b799dd06c824b30331a7ef708b07194ec4febb79c3433832d7629a1418ae7a1a",
                            ToHexString(transaction.GetTransactionHash()));
        }