Skip to content

Commit

Permalink
fix codecs errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan-tbd committed Apr 16, 2024
1 parent a6a9363 commit fc9436b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/web5/test/dids/did_dht/dns/answer_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ void main() {
ttl: 7200,
);

final result = AnswerCodec.encode(answer);
final result = Answer.codec.encode(answer);
final vector = hex.decode(
'035f6b31045f6469643468706d70397575723536356e6b696d7077647a6f6d376568627561626e736261363538787777796e796b37617763643135626b6f000010000100001c2000393869643d7369673b743d303b6b3d49783972543434514b6e496a4e654235312d4f526c776f43624c4b722d68734f59676c34674e39547a4955',
);

expect(result.value, vector);

final decoded = AnswerCodec.decode(Uint8List.fromList(vector));
final decoded = Answer.codec.decode(Uint8List.fromList(vector));
expect(decoded.value.data is TxtData, isTrue);
expect(
const ListEquality().equals(
Expand Down
2 changes: 1 addition & 1 deletion packages/web5/test/dids/did_dht/dns/packet_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ void main() {
final vector = hex.decode(
'000084000000000500000000035f6b30045f6469643435636168636668337a683862716435636e337936696e6f656131623364366b683835726a6b736e65396535646379726331657279000010000100001c2000373669643d303b743d303b6b3d327a484746356d5f4468635062425a42366f6f4978494f522d56772d794a565953506f324e67434d6b6767035f6b31045f6469643435636168636668337a683862716435636e337936696e6f656131623364366b683835726a6b736e65396535646379726331657279000010000100001c2000393869643d7369673b743d303b6b3d4672724268717641577845346c73746a2d4957674e385f352d4f344c314b755a6a644e6a6e3562585f6477035f6b32045f6469643435636168636668337a683862716435636e337936696e6f656131623364366b683835726a6b736e65396535646379726331657279000010000100001c2000656469643d656e633b743d313b6b3d4248746636516c6d634350584d5861364c565369455f4c652d59725a4e746c354b5770517a386536566157453563416c426d6e7a7a7577524e7546744c6879464e64793976317256457145677246456969774b4d783549035f7330045f6469643435636168636668337a683862716435636e337936696e6f656131623364366b683835726a6b736e65396535646379726331657279000010000100001c20004e4d69643d64776e3b743d446563656e7472616c697a65645765624e6f64653b73653d68747470733a2f2f6578616d706c652e636f6d2f64776e3b656e633d23656e633b7369673d237369672c2330045f6469643435636168636668337a683862716435636e337936696e6f656131623364366b683835726a6b736e65396535646379726331657279000010000100001c20004140763d303b766d3d6b302c6b312c6b323b617574683d6b302c6b313b61736d3d6b302c6b313b61676d3d6b323b64656c3d6b303b696e763d6b303b7376633d7330',
);
final dnsPacket = PacketCodec.decode(Uint8List.fromList(vector));
final dnsPacket = Packet.codec.decode(Uint8List.fromList(vector));

expect(dnsPacket.value.header.numQuestions, 0);
expect(dnsPacket.value.header.numAnswers, 5);
Expand Down

0 comments on commit fc9436b

Please sign in to comment.