Skip to content

Commit

Permalink
Use latest MTKruto
Browse files Browse the repository at this point in the history
  • Loading branch information
rojvv committed May 17, 2024
1 parent 4d72dac commit 14e7323
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 411 deletions.
2 changes: 1 addition & 1 deletion MTKruto
Submodule MTKruto updated 112 files
2 changes: 1 addition & 1 deletion client_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import * as path from "std/path/mod.ts";
import { existsSync } from "std/fs/exists.ts";
import { unreachable } from "std/assert/unreachable.ts";

import { InputError } from "mtkruto/0_errors.ts";
import { Mutex, Queue } from "mtkruto/1_utilities.ts";
import {
Client,
errors,
InputError,
InvokeErrorHandler,
NetworkStatistics,
Update,
Expand Down
5 changes: 2 additions & 3 deletions disallowed_functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import { functions, name } from "mtkruto/mod.ts";
import { isMtprotoFunction } from "mtkruto/client/0_utilities.ts";

const DISALLOWED_FUNCTIONS = [
Expand Down Expand Up @@ -66,11 +65,11 @@ const DISALLOWED_FUNCTIONS = [
];

export function isFunctionDisallowed(function_: any) {
if (function_ instanceof functions.ping) {
if (function_._ == "ping") {
return false;
}

if (DISALLOWED_FUNCTIONS.includes(function_[name])) {
if (DISALLOWED_FUNCTIONS.includes(function_._)) {
return true;
}

Expand Down
138 changes: 0 additions & 138 deletions tests/tl_json/deserialize_test.ts

This file was deleted.

114 changes: 0 additions & 114 deletions tests/tl_json/serialize_test.ts

This file was deleted.

8 changes: 7 additions & 1 deletion tests/transform_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ import { transform } from "../transform.ts";

Deno.test("transform", () => {
const date = new Date();
const a = { _: { _: { _: date, a: [date, date] } } };
const bigint = 123123n;
const buffer = crypto.getRandomValues(new Uint8Array(1024));
const a = {
_: {
_: { _: date, a: [buffer, date, date], bigint, c: bigint, x: buffer },
},
};
assertEquals(transform(transform(a)), a);
});
Loading

0 comments on commit 14e7323

Please sign in to comment.