Skip to content

Commit 9360d40

Browse files
committed
refactor for new verion chia utils irrulast compare
1 parent 577a1f4 commit 9360d40

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

example/lib/test_functions.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ Future<void> runTest(ValueChanged send) async {
8989
send("-------------------");
9090
stopWatch.reset();
9191
stopWatch.start();
92-
final programDart = chia_crypto_utils.Program.fromBytes(catModBytes.byteList);
92+
final programDart =
93+
chia_crypto_utils.Program.deserialize(catModBytes.byteList);
9394
final puzzleHashDart = programDart.hash();
9495
send(
9596
"ProgramDart: ${'${(await program.serializeToHex()).substring(0, 20)}...'}");
@@ -123,14 +124,14 @@ Future<void> dartCurry(ValueChanged send) async {
123124
final programArgs0 = chia_crypto_utils.Program.deserializeHex("ff0180");
124125
final programRust0Curry = programRust0.curry([programArgs0]);
125126
send(
126-
"ProgramDart curry: ${'${programRust0Curry.serializeHex().substring(0, 20)}...'}");
127+
"ProgramDart curry: ${'${programRust0Curry.toBytes().toHex().substring(0, 20)}...'}");
127128
final hash = programRust0Curry.hash();
128129
send("ProgramDart hash: $hash");
129130
stopWatch.stop();
130131
send("ProgramDart curry time: ${stopWatch.elapsedMilliseconds} μs");
131132
final uncurry = programRust0Curry.uncurry();
132133
send(
133-
"ProgramDart uncurry: ${'${uncurry.mod.serializeHex().substring(0, 20)}...'}");
134+
"ProgramDart uncurry: ${'${uncurry.mod.toBytes().toHex().substring(0, 20)}...'}");
134135
}
135136

136137
Future<void> rustCurry(ValueChanged send) async {

0 commit comments

Comments
 (0)