mirror of
				https://github.com/ton-blockchain/ton
				synced 2025-03-09 15:40:10 +00:00 
			
		
		
		
	updated tonlib, block routing
- upated tonlib - fixed bug in message routing
This commit is contained in:
		
							parent
							
								
									ac3eb1a7b8
								
							
						
					
					
						commit
						fd7a8de970
					
				
					 33 changed files with 1002 additions and 381 deletions
				
			
		| 
						 | 
				
			
			@ -59,12 +59,12 @@ class TonTest {
 | 
			
		|||
        val client = ClientKotlin()
 | 
			
		||||
        val dir = getContext().getExternalFilesDir(null).toString() + "/";
 | 
			
		||||
        runBlocking {
 | 
			
		||||
            client.send(TonApi.Init(TonApi.Options(config, dir)))
 | 
			
		||||
            client.send(TonApi.Init(TonApi.Options(TonApi.Config(config, "", false, false), dir)))
 | 
			
		||||
            val key = client.send(TonApi.CreateNewKey("local password".toByteArray(), "mnemonic password".toByteArray(), "".toByteArray())) as TonApi.Key
 | 
			
		||||
            val walletAddress = client.send(TonApi.TestWalletGetAccountAddress(TonApi.TestWalletInitialAccountState(key.publicKey))) as TonApi.AccountAddress;
 | 
			
		||||
            val testGiverState = client.send(TonApi.TestGiverGetAccountState()) as TonApi.TestGiverAccountState
 | 
			
		||||
 | 
			
		||||
            client.send(TonApi.TestGiverSendGrams(walletAddress, testGiverState.seqno, 6660000000)) as TonApi.Ok
 | 
			
		||||
            client.send(TonApi.TestGiverSendGrams(walletAddress, testGiverState.seqno, 6660000000, "".toByteArray())) as TonApi.Ok
 | 
			
		||||
 | 
			
		||||
            while ((client.send(TonApi.GenericGetAccountState(walletAddress)) as TonApi.GenericAccountStateUninited).accountState.balance <= 0L) {
 | 
			
		||||
                delay(1000L)
 | 
			
		||||
| 
						 | 
				
			
			@ -79,7 +79,7 @@ class TonTest {
 | 
			
		|||
 | 
			
		||||
            val state = client.send(TonApi.GenericGetAccountState(walletAddress)) as TonApi.GenericAccountStateTestWallet
 | 
			
		||||
            val balance = state.accountState.balance
 | 
			
		||||
            client.send(TonApi.GenericSendGrams(inputKey, walletAddress, walletAddress, 10)) as TonApi.Ok
 | 
			
		||||
            client.send(TonApi.GenericSendGrams(inputKey, walletAddress, walletAddress, 10, 0, true, "hello".toByteArray())) as TonApi.Ok
 | 
			
		||||
            while ((client.send(TonApi.GenericGetAccountState(walletAddress)) as TonApi.GenericAccountStateTestWallet).accountState.balance == balance) {
 | 
			
		||||
                delay(1000L)
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -86,7 +86,7 @@ public class TonTestJava {
 | 
			
		|||
        appendLog("start...");
 | 
			
		||||
 | 
			
		||||
            JavaClient client = new JavaClient();
 | 
			
		||||
            Object result = client.send(new TonApi.Init(new TonApi.Options(config, getContext().getExternalFilesDir(null) + "/")));
 | 
			
		||||
            Object result = client.send(new TonApi.Init(new TonApi.Options(new TonApi.Config(config, "", false, false), getContext().getExternalFilesDir(null) + "/")));
 | 
			
		||||
            if (!(result instanceof TonApi.Ok)) {
 | 
			
		||||
                appendLog("failed to set config");
 | 
			
		||||
                return;
 | 
			
		||||
| 
						 | 
				
			
			@ -98,7 +98,7 @@ public class TonTestJava {
 | 
			
		|||
            appendLog("got account address");
 | 
			
		||||
            appendLog("sending grams...");
 | 
			
		||||
            TonApi.TestGiverAccountState testGiverState = (TonApi.TestGiverAccountState) client.send(new TonApi.TestGiverGetAccountState());
 | 
			
		||||
            result = client.send(new TonApi.TestGiverSendGrams(walletAddress, testGiverState.seqno, 6660000000L));
 | 
			
		||||
            result = client.send(new TonApi.TestGiverSendGrams(walletAddress, testGiverState.seqno, 6660000000L, "".getBytes()));
 | 
			
		||||
            if (!(result instanceof TonApi.Ok)) {
 | 
			
		||||
                appendLog("failed to send grams");
 | 
			
		||||
                return;
 | 
			
		||||
| 
						 | 
				
			
			@ -143,7 +143,7 @@ public class TonTestJava {
 | 
			
		|||
            appendLog("sending grams...");
 | 
			
		||||
            TonApi.GenericAccountStateTestWallet state = (TonApi.GenericAccountStateTestWallet) client.send(new TonApi.GenericGetAccountState(walletAddress));
 | 
			
		||||
            long balance = state.accountState.balance;
 | 
			
		||||
            result = client.send(new TonApi.GenericSendGrams(inputKey, walletAddress, walletAddress, 10));
 | 
			
		||||
            result = client.send(new TonApi.GenericSendGrams(inputKey, walletAddress, walletAddress, 10, 0, true, "hello".getBytes()));
 | 
			
		||||
            if (!(result instanceof TonApi.Ok)) {
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue