public async Task Test_Debot_Transaction_Chain()
        {
            var browser = await _fixture.GetDebotBrowserAsync(_logger);

            await browser.ExecuteWithDetailsAsync(new List <DebotStep>(),
                                                  new DebotInfo
            {
                Name       = "TestDeBot9",
                Version    = "0.1.0",
                Publisher  = "TON Labs",
                Caption    = "TestDeBot9",
                Author     = "TON Labs",
                Support    = "0:0000000000000000000000000000000000000000000000000000000000000000",
                Hello      = "TestDeBot9",
                Language   = "en",
                Dabi       = ((Abi.Contract)_fixture.Debot.Abi).Value.ToJson().ToString(),
                Icon       = "",
                Interfaces = new[]
                {
                    "0x8796536366ee21852db56dccb60bc564598b618c865fc50c8b1ab740bba128e3"
                }
            }, new List <ExpectedTransaction>(),
                                                  new List <string> {
                "Test passed"
            });
        }
        public async Task Test_Debot_Sdk_Get_Accounts_By_Hash()
        {
            var browser = await _fixture.GetDebotBrowserAsync(_logger);

            var count = await _fixture.Debot.Client.CountAccountsByCodeHashAsync(_fixture.Debot.Tvc);

            await browser.ExecuteAsync(new List <DebotStep>(), new List <string>
            {
                $"{count} contracts."
            });
        }
示例#3
0
        public async Task Test_Debot_Invoke_Msgs()
        {
            var browser = await _fixture.GetDebotBrowserAsync(_logger);

            await browser.ExecuteAsync(new List <DebotStep>(), new List <string>
            {
                "Invoking Debot B",
                "DebotB receives question: What is your name?",
                "DebotA receives answer: My name is DebotB"
            });
        }
        public async Task Test_Debot4()
        {
            var browser = await _fixture.GetDebotBrowserAsync(_logger);

            var targetBoc = await _fixture.Debot.Client.DownloadAccountAsync(_fixture.Debot.TargetAddr);

            Assert.NotNull(targetBoc);

            var account = await _fixture.Debot.Client.Boc.ParseAccountAsync(new ParamsOfParse
            {
                Boc = targetBoc
            });

            Assert.Equal(0, account.Parsed.Value <int>("acc_type"));

            await browser.ExecuteAsync(new List <DebotStep>(), new List <string>
            {
                "Target contract deployed.",
                "Enter 1",
                "getData",
                "setData(128)",
                "Sign external message:",
                "Transaction succeeded",
                "setData2(129)"
            });

            targetBoc = await _fixture.Debot.Client.DownloadAccountAsync(_fixture.Debot.TargetAddr);

            Assert.NotNull(targetBoc);

            account = await _fixture.Debot.Client.Boc.ParseAccountAsync(new ParamsOfParse
            {
                Boc = targetBoc
            });

            Assert.Equal(1, account.Parsed.Value <int>("acc_type"));

            await _fixture.Debot.Client.AssertGetMethodAsync(
                _fixture.Debot.TargetAddr,
                _fixture.Debot.TargetAbi,
                "getData",
                new
            {
                key = 1
            }, new
            {
                num = "0x0000000000000000000000000000000000000000000000000000000000000081"
            });
        }
        public async Task Test_Debot_Json_Approve()
        {
            var browser = await _fixture.GetDebotBrowserAsync(_logger);

            var debotAddress = _fixture.Debot.Address;
            await browser.ExecuteWithDetailsAsync(new List <DebotStep>(),
                                                  new DebotInfo
            {
                Name       = "testDebot6",
                Version    = "0.1.0",
                Publisher  = "TON Labs",
                Caption    = "Test for approve callback and signing handle",
                Author     = "TON Labs",
                Support    = "0:0000000000000000000000000000000000000000000000000000000000000000",
                Hello      = "testDebot6",
                Language   = "en",
                Dabi       = ((Abi.Contract)_fixture.Debot.Abi).Value.ToJson().ToString(),
                Icon       = "",
                Interfaces = new[]
                {
                    "0x8796536366ee21852db56dccb60bc564598b618c865fc50c8b1ab740bba128e3",
                    "0xc13024e101c95e71afb1f5fa6d72f633d51e721de0320d73dfd6121a54e4d40a"
                }
            }, new List <ExpectedTransaction>
            {
                new()
                {
                    Dst      = debotAddress,
                    Out      = new List <Spending>(),
                    Setcode  = false,
                    Signkey  = _fixture.Debot.Keys.Public,
                    Approved = true
                },
                new()
                {
                    Dst = debotAddress,
                    Out = new List <Spending>
                    {
                        new()
                        {
                            Amount = 10000000000,
                            Dst    = debotAddress
                        }
                    },
                    Setcode  = false,
                    Signkey  = _fixture.Debot.Keys.Public,
                    Approved = false
                },
示例#6
0
        public async Task Test_Debot_Goto()
        {
            var browser = await _fixture.GetDebotBrowserAsync(_logger);

            await browser.ExecuteAsync(new List <DebotStep>
            {
                new DebotStep {
                    Choice = 1, Outputs = new List <string> {
                        "Test Goto Action"
                    }
                },
                new DebotStep {
                    Choice = 1, Outputs = new List <string> {
                        "Debot Tests"
                    }
                },
                new DebotStep {
                    Choice = TestDebotBrowser.ExitChoice, Outputs = new List <string>()
                }
            });
        }
示例#7
0
        public async Task Test_Debot_Inner_Interfaces()
        {
            var browser = await _fixture.GetDebotBrowserAsync(_logger);

            await browser.ExecuteWithDetailsAsync(new List <DebotStep>(),
                                                  new DebotInfo
            {
                Name       = "TestSdk",
                Version    = "0.4.0",
                Publisher  = "TON Labs",
                Caption    = "Test for SDK interface",
                Author     = "TON Labs",
                Support    = "0:0000000000000000000000000000000000000000000000000000000000000000",
                Hello      = "Hello, I'm a test.",
                Language   = "en",
                Dabi       = ((Abi.Contract)_fixture.Debot.Abi).Value.ToJson().ToString(),
                Icon       = "",
                Interfaces = new string[] {
                    "0x8796536366ee21852db56dccb60bc564598b618c865fc50c8b1ab740bba128e3"
                }
            },
                                                  new List <ExpectedTransaction>(),
                                                  new List <string>
            {
                "test substring1 passed",
                "test substring2 passed",
                "test mnemonicDeriveSignKeys passed",
                "test genRandom passed",
                "test naclbox passed",
                "test naclKeypairFromSecret passed",
                "test hex encode passed",
                "test base64 encode passed",
                "test mnemonic passed",
                "test naclboxopen passed",
                "test account passed",
                "test hdkeyXprv passed",
                "test sign hash passed",
                "test hex decode passed",
                "test base64 decode passed"
            });
        }
示例#8
0
        public async Task Test_Debot_Json_Interface()
        {
            var browser = await _fixture.GetDebotBrowserAsync(_logger);

            await browser.ExecuteWithDetailsAsync(new List <DebotStep>(),
                                                  new DebotInfo
            {
                Name       = "Test DeBot 7",
                Version    = "0.1.0",
                Publisher  = "TON Labs",
                Caption    = "Test for Json interface",
                Author     = "TON Labs",
                Support    = "0:0000000000000000000000000000000000000000000000000000000000000000",
                Hello      = "Test DeBot 7",
                Language   = "en",
                Dabi       = ((Abi.Contract)_fixture.Debot.Abi).Value.ToJson().ToString(),
                Icon       = "",
                Interfaces = new string[] {
                    "0x8796536366ee21852db56dccb60bc564598b618c865fc50c8b1ab740bba128e3",
                    "0x442288826041d564ccedc579674f17c1b0a3452df799656a9167a41ab270ec19"
                }
            }, new List <ExpectedTransaction>(), new List <string>());
        }