From 9360d406a1f51adb54f6957c5d009ed7302c9fad Mon Sep 17 00:00:00 2001 From: Marvin Quevedo Date: Tue, 21 Nov 2023 19:00:39 -0600 Subject: [PATCH] refactor for new verion chia utils irrulast compare --- example/lib/test_functions.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/example/lib/test_functions.dart b/example/lib/test_functions.dart index 4d741b6..e46a9a2 100644 --- a/example/lib/test_functions.dart +++ b/example/lib/test_functions.dart @@ -89,7 +89,8 @@ Future runTest(ValueChanged send) async { send("-------------------"); stopWatch.reset(); stopWatch.start(); - final programDart = chia_crypto_utils.Program.fromBytes(catModBytes.byteList); + final programDart = + chia_crypto_utils.Program.deserialize(catModBytes.byteList); final puzzleHashDart = programDart.hash(); send( "ProgramDart: ${'${(await program.serializeToHex()).substring(0, 20)}...'}"); @@ -123,14 +124,14 @@ Future dartCurry(ValueChanged send) async { final programArgs0 = chia_crypto_utils.Program.deserializeHex("ff0180"); final programRust0Curry = programRust0.curry([programArgs0]); send( - "ProgramDart curry: ${'${programRust0Curry.serializeHex().substring(0, 20)}...'}"); + "ProgramDart curry: ${'${programRust0Curry.toBytes().toHex().substring(0, 20)}...'}"); final hash = programRust0Curry.hash(); send("ProgramDart hash: $hash"); stopWatch.stop(); send("ProgramDart curry time: ${stopWatch.elapsedMilliseconds} μs"); final uncurry = programRust0Curry.uncurry(); send( - "ProgramDart uncurry: ${'${uncurry.mod.serializeHex().substring(0, 20)}...'}"); + "ProgramDart uncurry: ${'${uncurry.mod.toBytes().toHex().substring(0, 20)}...'}"); } Future rustCurry(ValueChanged send) async {