mirror of
				https://github.com/ton-blockchain/ton
				synced 2025-03-09 15:40:10 +00:00 
			
		
		
		
	Merge pull request #450 from ton-blockchain/dns-resolve-update
Fix DNS resolve in liteclient and tonlib
This commit is contained in:
		
						commit
						35d17249e6
					
				
					 3 changed files with 9 additions and 4 deletions
				
			
		| 
						 | 
					@ -814,7 +814,7 @@ vmc_pushint$1111 value:int32 next:^VmCont = VmCont;
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
//  DNS RECORDS
 | 
					//  DNS RECORDS
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
_ (HashmapE 256 DNSRecord) = DNS_RecordSet;
 | 
					_ (HashmapE 256 ^DNSRecord) = DNS_RecordSet;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
chunk_ref$_ {n:#} ref:^(TextChunks (n + 1)) = TextChunkRef (n + 1);
 | 
					chunk_ref$_ {n:#} ref:^(TextChunks (n + 1)) = TextChunkRef (n + 1);
 | 
				
			||||||
chunk_ref_empty$_ = TextChunkRef 0;
 | 
					chunk_ref_empty$_ = TextChunkRef 0;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -433,8 +433,12 @@ td::Result<std::vector<ManualDns::RawEntry>> ManualDns::resolve_raw_or_throw(td:
 | 
				
			||||||
  } else {
 | 
					  } else {
 | 
				
			||||||
    if (category.is_zero()) {
 | 
					    if (category.is_zero()) {
 | 
				
			||||||
      vm::Dictionary dict(std::move(data), 256);
 | 
					      vm::Dictionary dict(std::move(data), 256);
 | 
				
			||||||
      dict.check_for_each([&](auto cs, td::ConstBitPtr key, int n) {
 | 
					      dict.check_for_each([&](td::Ref<vm::CellSlice> cs, td::ConstBitPtr key, int n) {
 | 
				
			||||||
        CHECK(n == 256);
 | 
					        CHECK(n == 256);
 | 
				
			||||||
 | 
					        if (cs.is_null() || cs->size_ext() != 0x10000) {
 | 
				
			||||||
 | 
					          return true;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        cs = vm::load_cell_slice_ref(cs->prefetch_ref());
 | 
				
			||||||
        vec.push_back({name.str(), td::Bits256(key), cs});
 | 
					        vec.push_back({name.str(), td::Bits256(key), cs});
 | 
				
			||||||
        return true;
 | 
					        return true;
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1812,10 +1812,11 @@ void TestNode::dns_resolve_finish(ton::WorkchainId workchain, ton::StdSmcAddress
 | 
				
			||||||
      if (!dict.check_for_each([this, &out](Ref<vm::CellSlice> cs, td::ConstBitPtr key, int n) {
 | 
					      if (!dict.check_for_each([this, &out](Ref<vm::CellSlice> cs, td::ConstBitPtr key, int n) {
 | 
				
			||||||
            CHECK(n == 256);
 | 
					            CHECK(n == 256);
 | 
				
			||||||
            td::Bits256 x{key};
 | 
					            td::Bits256 x{key};
 | 
				
			||||||
            /*if (cs.is_null() || cs->size_ext() != 0x10000) {
 | 
					            if (cs.is_null() || cs->size_ext() != 0x10000) {
 | 
				
			||||||
              out << "category " << x << " : value is not a reference" << std::endl;
 | 
					              out << "category " << x << " : value is not a reference" << std::endl;
 | 
				
			||||||
              return true;
 | 
					              return true;
 | 
				
			||||||
            }*/
 | 
					            }
 | 
				
			||||||
 | 
					            cs = vm::load_cell_slice_ref(cs->prefetch_ref());
 | 
				
			||||||
            std::ostringstream os;
 | 
					            std::ostringstream os;
 | 
				
			||||||
            (void)show_dns_record(os, x, cs, true);
 | 
					            (void)show_dns_record(os, x, cs, true);
 | 
				
			||||||
            out << "category " << x << " : " << os.str() << std::endl;
 | 
					            out << "category " << x << " : " << os.str() << std::endl;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue