Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 33 additions & 5 deletions src/ar_bundles.erl
Original file line number Diff line number Diff line change
Expand Up @@ -575,11 +575,16 @@ decode_signature(Other) ->
decode_tags(<<0:64/little-integer, 0:64/little-integer, Rest/binary>>) ->
{[], Rest};
decode_tags(<<_TagCount:64/little-integer, _TagSize:64/little-integer, Binary/binary>>) ->
{Count, BlocksBinary} = decode_zigzag(Binary),
{Tags, Rest} = decode_avro_tags(BlocksBinary, Count),
%% Pull out the terminating zero
{0, Rest2} = decode_zigzag(Rest),
{Tags, Rest2}.
case decode_zigzag(Binary) of
{0, Rest} ->
%% count=0 is itself the Avro end-of-array terminator; no items, no second zero.
{[], Rest};
{Count, BlocksBinary} ->
{Tags, Rest} = decode_avro_tags(BlocksBinary, Count),
%% Pull out the terminating zero block that follows the last item block.
{0, Rest2} = decode_zigzag(Rest),
{Tags, Rest2}
end.

decode_optional_field(<<0, Rest/binary>>) ->
{<<>>, Rest};
Expand All @@ -591,6 +596,11 @@ decode_avro_tags(<<>>, _) ->
{[], <<>>};
decode_avro_tags(Binary, Count) when Count =:= 0 ->
{[], Binary};
decode_avro_tags(Binary, Count) when Count < 0 ->
%% Avro long-form block: negative count encodes item count as abs(Count),
%% followed by a zigzag-encoded byte size which we skip.
{_ByteBlockSize, Rest} = decode_zigzag(Binary),
decode_avro_tags(Rest, -Count);
decode_avro_tags(Binary, Count) ->
{NameSize, Rest} = decode_zigzag(Binary),
decode_avro_name(NameSize, Rest, Count).
Expand Down Expand Up @@ -1161,3 +1171,21 @@ deserialize_ethereum_transaction_test() ->
?assertEqual(<<"0x626334b6ef6D3e8537E9f8d97d65f59832219315">>,
hb_util:human_id(ar_wallet:to_address(Deserialized#tx.owner, Deserialized#tx.signature_type))),
?assert(verify_item(Deserialized)).

%% @doc Test TX header with avro with negative count.
%% TXID: sfuxzQEEIFo5w6swrIPNjqUXCkaRm1BiuP5E3tmuNeU
deserialize_header_test() ->
Binary = <<3,0,159,201,29,54,204,49,217,185,169,30,79,27,113,154,209,149,155,4,94,109,231,29,126,91,206,2,58,46,48,92,26,78,97,101,237,211,88,230,249,10,184,209,7,255,179,104,207,12,190,33,166,28,50,204,70,145,233,91,105,67,114,10,93,238,28,4,215,155,88,31,136,43,116,83,120,249,145,176,234,17,216,136,40,180,180,163,138,235,206,53,81,171,155,115,126,116,41,35,253,114,207,9,111,109,251,54,165,211,123,116,38,234,140,182,15,169,158,249,185,207,52,106,5,41,28,28,118,69,217,53,0,0,2,0,0,0,0,0,0,0,112,0,0,0,0,0,0,0,3,216,1,18,73,80,70,83,45,72,97,115,104,118,98,97,102,107,114,101,105,98,103,100,115,97,104,54,122,111,108,50,101,111,101,54,98,112,120,54,51,104,99,55,117,51,112,107,53,120,105,106,51,116,120,110,98,120,102,120,97,116,116,97,116,113,51,108,108,52,119,100,97,24,67,111,110,116,101,110,116,45,84,121,112,101,48,97,112,112,108,105,99,97,116,105,111,110,47,111,99,116,101,116,45,115,116,114,101,97,109,0,82,73,70,70,34,0,0,0,87,69,66,80,86,80,56,76,21,0,0,0,47,99,192,24,0,7,16,17,253,15,3,144,16,254,239,151,34,250,159,74,4,0>>,
{ok, _, TXheader} = deserialize_header(Binary),
[{T1, V1}, {T2, V2}] = TXheader#tx.tags,
?assertEqual(<<"IPFS-Hash">>, T1),
?assertEqual(<<"bafkreibgdsah6zol2eoe6bpx63hc7u3pk5xij3txnbxfxattatq3ll4wda">>, V1),
?assertEqual(<<"Content-Type">>, T2),
?assertEqual(<<"application/octet-stream">>, V2).

%% @doc Test TX with tag_count=0 and tag_byte_size=1 (single 0x00 Avro terminator).
%% TXID: 8cjDy2khfMsc3hrvGp7PrLVYfD_4aYQxEILNSZ0Pv74
deserialize_header_zero_tags_test() ->
Binary = <<1,0,18,82,93,211,156,242,244,169,161,47,166,208,115,36,213,40,0,93,154,240,8,204,20,212,104,151,139,9,128,241,81,27,11,57,160,166,69,192,186,39,42,227,40,237,130,69,179,65,136,42,80,65,139,79,25,65,153,143,46,15,132,111,87,243,246,67,181,142,222,225,147,110,169,242,74,192,105,255,120,19,209,63,112,186,141,170,140,103,45,0,211,110,163,82,135,225,255,208,107,100,3,152,255,81,154,126,86,97,163,28,62,180,189,114,89,160,66,187,111,125,66,109,170,58,123,61,184,219,142,116,35,103,150,240,248,53,150,212,192,41,85,108,128,184,101,193,27,132,181,143,15,11,191,248,33,41,240,210,238,48,102,172,50,166,214,39,64,109,63,59,230,203,223,73,29,160,231,104,134,147,74,57,203,0,50,89,33,127,157,189,246,131,158,162,39,239,221,254,204,89,80,61,114,150,64,63,118,46,140,6,108,49,94,201,118,236,101,27,77,104,189,52,185,12,133,36,54,147,231,201,110,213,71,233,29,52,157,226,155,90,44,212,250,10,52,210,35,59,68,148,166,228,94,97,65,90,246,57,92,170,53,51,77,192,244,62,201,15,55,55,200,121,224,215,182,124,227,130,27,20,133,20,184,45,80,240,55,144,69,75,241,149,161,35,178,2,76,86,47,116,208,124,252,36,111,95,55,138,254,75,253,190,155,10,60,132,70,38,212,182,215,219,125,128,195,11,200,55,2,254,250,188,172,56,165,118,160,31,170,89,144,194,231,138,50,13,0,157,171,171,5,109,15,84,207,112,17,28,47,241,135,102,184,93,161,9,217,110,155,38,229,78,168,18,26,200,67,18,138,179,37,96,53,34,234,230,52,135,152,2,235,76,231,195,71,34,157,128,29,60,58,166,222,58,7,252,194,120,77,53,126,1,111,189,35,252,150,36,238,153,22,104,198,183,169,228,197,6,23,65,72,48,128,185,242,229,123,234,251,95,182,36,36,232,125,164,253,137,69,117,123,224,247,128,38,82,229,26,129,164,38,33,159,92,182,124,100,81,66,111,93,32,29,8,78,37,74,89,127,97,96,152,166,198,6,107,67,35,193,209,38,247,181,139,163,49,127,19,91,124,74,244,204,168,187,235,191,122,106,174,150,76,191,24,214,127,38,161,212,173,48,67,70,229,238,61,83,12,113,62,250,65,191,183,157,18,202,100,136,209,199,81,241,15,3,88,39,135,178,184,58,148,107,175,186,180,132,157,26,157,24,95,47,8,162,28,3,118,66,213,6,77,219,52,180,67,19,254,191,115,164,187,70,25,124,141,48,150,100,64,55,18,71,246,116,51,233,203,163,91,112,107,226,9,98,146,87,91,229,11,80,103,123,169,251,119,194,87,150,250,225,4,193,18,199,151,15,157,102,249,18,53,17,253,39,17,63,222,5,126,52,81,191,47,73,154,18,228,62,24,106,107,176,251,63,84,167,135,6,5,93,141,50,88,12,102,236,224,223,227,60,158,139,89,252,62,173,1,133,135,47,232,244,158,255,170,207,235,52,221,202,238,182,172,33,131,78,227,138,211,6,201,53,178,85,17,69,2,104,221,137,222,191,110,185,60,17,219,112,98,173,110,146,105,91,108,206,189,213,39,162,33,255,223,252,71,102,179,138,174,207,129,192,31,39,180,139,253,57,128,188,223,192,79,35,111,121,86,63,165,54,201,240,149,118,185,58,202,47,95,63,129,242,182,212,29,138,132,91,214,194,214,124,52,57,131,245,121,136,15,109,75,121,133,72,96,213,72,47,17,214,188,240,42,106,32,226,101,64,196,6,122,144,67,206,148,18,131,139,72,6,182,149,176,188,235,217,105,57,180,82,226,57,58,33,116,123,117,237,198,0,66,76,63,243,210,40,116,10,70,24,220,109,12,13,7,57,146,203,165,38,118,211,75,141,33,97,114,5,231,8,56,48,38,22,135,86,239,113,240,200,149,249,109,14,99,66,27,33,60,224,220,45,90,208,94,214,73,64,7,96,77,31,78,205,192,62,21,152,241,104,29,59,37,136,214,23,33,123,19,114,233,39,182,2,237,147,194,16,125,174,219,118,93,118,93,136,93,192,87,70,194,235,128,189,254,11,166,87,132,173,14,165,156,2,230,246,12,86,212,5,105,51,115,199,80,80,139,135,177,225,177,190,93,29,100,177,207,43,68,87,111,129,187,86,68,126,99,230,197,39,41,212,137,251,47,235,109,229,0,251,17,223,32,156,185,52,180,8,246,187,178,27,136,66,196,125,142,54,128,56,200,108,65,0,1,188,29,211,86,11,51,139,73,247,84,155,179,70,10,236,247,120,180,171,217,67,163,222,9,142,221,1,205,187,99,159,180,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,91,91,53,57,48,52,57,44,32,123,34,100,105,116,101,109,34,58,32,91,34,115,116,80,97,105,68,82,80,98,101,103,102,78,116,90,118,69,55,77,119,118,45,97,75,118,95,116,57,79,90,73,108,74,117,101,52,97,121,67,74,121,80,119,34,93,44,32,34,109,105,110,95,98,108,111,99,107,34,58,32,91,49,49,50,52,52,52,51,44,32,34,72,101,72,89,89,111,65,107,82,73,75,119,74,90,98,95,112,110,116,50,72,120,122,80,114,80,69,120,106,90,57,85,66,49,109,81,102,85,113,71,57,122,107,70,48,71,65,107,119,97,67,119,55,99,51,77,103,88,112,117,116,100,75,71,34,93,44,32,34,97,112,105,95,116,105,109,101,115,116,97,109,112,34,58,32,49,54,55,55,49,51,54,49,49,48,56,57,55,125,44,32,48,44,32,51,48,50,53,54,55,54,54,51,49,93,44,32,91,53,57,48,52,57,44,32,123,34,100,105,116,101,109,34,58,32,91,34,51,95,104,65,77,78,71,48,105,104,100,53,77,51,77,102,108,66,100,97,113,79,120,120,113,72,100,74,79,104,56,105,102,66,56,104,49,45,109,53,95,79,52,34,93,44,32,34,109,105,110,95,98,108,111,99,107,34,58,32,91,49,49,50,52,52,52,51,44,32,34,72,101,72,89,89,111,65,107,82,73,75,119,74,90,98,95,112,110,116,50,72,120,122,80,114,80,69,120,106,90,57,85,66,49,109,81,102,85,113,71,57,122,107,70,48,71,65,107,119,97,67,119,55,99,51,77,103,88,112,117,116,100,75,71,34,93,44,32,34,97,112,105,95,116,105,109,101,115,116,97,109,112,34,58,32,49,54,55,55,49,56,54,48,55,55,53,49,57,125,44,32,51,48,50,53,54,55,54,54,51,49,44,32,49,53,52,56,55,53,48,49,50,56,93,44,32,91,49,57,54,56,51,44,32,123,34,100,105,116,101,109,34,58,32,91,34,56,103,104,54,117,119,68,115,119,77,111,49,80,81,112,83,87,121,51,49,110,104,52,97,118,68,87,82,71,112,107,103,95,117,80,101,79,88,90,49,73,121,65,34,93,44,32,34,109,105,110,95,98,108,111,99,107,34,58,32,91,49,49,50,52,52,52,51,44,32,34,72,101,72,89,89,111,65,107,82,73,75,119,74,90,98,95,112,110,116,50,72,120,122,80,114,80,69,120,106,90,57,85,66,49,109,81,102,85,113,71,57,122,107,70,48,71,65,107,119,97,67,119,55,99,51,77,103,88,112,117,116,100,75,71,34,93,44,32,34,97,112,105,95,116,105,109,101,115,116,97,109,112,34,58,32,49,54,55,55,50,48,51,55,51,56,57,55,57,125,44,32,52,53,55,52,52,50,54,55,53,57,44,32,53,55,49,54,52,56,52,49,57,93,44,32,91,54,53,54,49,44,32,123,34,100,105,116,101,109,34,58,32,91,34,72,95,72,111,81,113,67,82,45,45,90,74,122,81,97,53,72,51,90,111,45,109,121,100,75,75,45,120,69,78,54,98,66,53,119,76,102,83,68,106,75,55,69,34,93,44,32,34,109,105,110,95,98,108,111,99,107,34,58,32,91,49,49,50,52,52,52,51,44,32,34,72,101,72,89,89,111,65,107,82,73,75,119,74,90,98,95,112,110,116,50,72,120,122,80,114,80,69,120,106,90,57,85,66,49,109,81,102,85,113,71,57,122,107,70,48,71,65,107,119,97,67,119,55,99,51,77,103,88,112,117,116,100,75,71,34,93,44,32,34,97,112,105,95,116,105,109,101,115,116,97,109,112,34,58,32,49,54,55,55,50,48,57,54,52,51,49,48,57,125,44,32,53,49,52,54,48,55,53,49,55,56,44,32,49,55,54,50,52,54,52,50,52,93,44,32,91,54,53,54,49,44,32,123,34,100,105,116,101,109,34,58,32,91,34,83,103,87,112,122,75,108,103,102,106,71,88,103,77,97,86,90,53,82,115,45,104,49,122,118,67,95,105,108,80,70,84,65,107,65,87,110,75,98,122,120,121,56,34,93,44,32,34,109,105,110,95,98,108,111,99,107,34,58,32,91,49,49,50,52,52,52,51,44,32,34,72,101,72,89,89,111,65,107,82,73,75,119,74,90,98,95,112,110,116,50,72,120,122,80,114,80,69,120,106,90,57,85,66,49,109,81,102,85,113,71,57,122,107,70,48,71,65,107,119,97,67,119,55,99,51,77,103,88,112,117,116,100,75,71,34,93,44,32,34,97,112,105,95,116,105,109,101,115,116,97,109,112,34,58,32,49,54,55,55,50,49,53,53,49,56,54,48,48,125,44,32,53,51,50,50,51,50,49,54,48,50,44,32,49,55,50,54,50,51,48,49,54,93,44,32,91,50,49,56,55,44,32,123,34,100,105,116,101,109,34,58,32,91,34,51,101,45,88,83,104,66,74,71,50,84,95,53,90,95,54,81,54,73,88,101,117,65,75,116,45,82,120,71,65,105,67,48,78,90,86,106,75,66,53,57,74,115,34,93,44,32,34,109,105,110,95,98,108,111,99,107,34,58,32,91,49,49,50,52,52,52,51,44,32,34,72,101,72,89,89,111,65,107,82,73,75,119,74,90,98,95,112,110,116,50,72,120,122,80,114,80,69,120,106,90,57,85,66,49,109,81,102,85,113,71,57,122,107,70,48,71,65,107,119,97,67,119,55,99,51,77,103,88,112,117,116,100,75,71,34,93,44,32,34,97,112,105,95,116,105,109,101,115,116,97,109,112,34,58,32,49,54,55,55,50,49,55,52,53,54,56,57,54,125,44,32,53,52,57,52,57,52,52,54,49,56,44,32,53,55,49,49,54,51,55,53,93,44,32,91,50,49,56,55,44,32,123,34,100,105,116,101,109,34,58,32,91,34,120,111,113,71,115,75,88,52,110,109,69,90,97,54,55,100,49,109,110,109,53,103,113,54,45,83,105,113,116,100,77,122,100,55,110,79,54,90,69,69,49,77,69,34,93,44,32,34,109,105,110,95,98,108,111,99,107,34,58,32,91,49,49,50,52,52,52,51,44,32,34,72,101,72,89,89,111,65,107,82,73,75,119,74,90,98,95,112,110,116,50,72,120,122,80,114,80,69,120,106,90,57,85,66,49,109,81,102,85,113,71,57,122,107,70,48,71,65,107,119,97,67,119,55,99,51,77,103,88,112,117,116,100,75,71,34,93,44,32,34,97,112,105,95,116,105,109,101,115,116,97,109,112,34,58,32,49,54,55,55,50,49,57,51,56,57,49,55,50,125,44,32,53,53,53,50,48,54,48,57,57,51,44,32,53,55,48,52,55,57,57,51,93,44,32,91,55,50,57,44,32,123,34,100,105,116,101,109,34,58,32,91,34,116,114,115,68,110,111,55,103,83,76,57,86,109,97,105,83,79,98,78,121,66,68,122,54,80,115,85,122,85,50,81,52,74,111,86,70,75,101,51,113,79,88,119,34,93,44,32,34,109,105,110,95,98,108,111,99,107,34,58,32,91,49,49,50,52,52,52,51,44,32,34,72,101,72,89,89,111,65,107,82,73,75,119,74,90,98,95,112,110,116,50,72,120,122,80,114,80,69,120,106,90,57,85,66,49,109,81,102,85,113,71,57,122,107,70,48,71,65,107,119,97,67,119,55,99,51,77,103,88,112,117,116,100,75,71,34,93,44,32,34,97,112,105,95,116,105,109,101,115,116,97,109,112,34,58,32,49,54,55,55,50,50,48,48,51,57,56,48,49,125,44,32,53,54,48,57,49,48,56,57,56,54,44,32,49,57,49,56,57,54,53,57,93,44,32,91,50,52,51,44,32,123,34,100,105,116,101,109,34,58,32,91,34,121,51,113,115,103,72,45,109,56,70,98,117,110,118,105,65,71,82,76,77,115,105,116,56,75,87,113,90,57,116,70,76,90,88,106,109,67,45,68,79,45,85,103,34,93,44,32,34,109,105,110,95,98,108,111,99,107,34,58,32,91,49,49,50,52,52,52,51,44,32,34,72,101,72,89,89,111,65,107,82,73,75,119,74,90,98,95,112,110,116,50,72,120,122,80,114,80,69,120,106,90,57,85,66,49,109,81,102,85,113,71,57,122,107,70,48,71,65,107,119,97,67,119,55,99,51,77,103,88,112,117,116,100,75,71,34,93,44,32,34,97,112,105,95,116,105,109,101,115,116,97,109,112,34,58,32,49,54,55,55,50,50,48,50,53,51,51,53,50,125,44,32,53,54,50,56,50,57,56,54,52,53,44,32,54,50,51,50,55,57,51,93,44,32,91,56,49,44,32,123,34,100,105,116,101,109,34,58,32,91,34,77,82,98,110,88,116,87,101,117,87,68,73,117,86,69,70,52,117,72,101,70,120,121,117,84,51,56,86,78,122,115,95,120,100,68,51,104,90,86,71,106,54,65,34,93,44,32,34,109,105,110,95,98,108,111,99,107,34,58,32,91,49,49,50,52,52,52,51,44,32,34,72,101,72,89,89,111,65,107,82,73,75,119,74,90,98,95,112,110,116,50,72,120,122,80,114,80,69,120,106,90,57,85,66,49,109,81,102,85,113,71,57,122,107,70,48,71,65,107,119,97,67,119,55,99,51,77,103,88,112,117,116,100,75,71,34,93,44,32,34,97,112,105,95,116,105,109,101,115,116,97,109,112,34,58,32,49,54,55,55,50,50,48,51,50,54,52,51,56,125,44,32,53,54,51,52,53,51,49,52,51,56,44,32,50,49,56,53,55,52,52,93,44,32,91,50,55,44,32,123,34,100,105,116,101,109,34,58,32,91,34,118,82,69,118,106,98,74,53,89,111,51,88,115,117,103,86,119,82,71,55,65,48,56,76,121,72,87,99,104,111,70,81,97,53,48,100,74,121,101,45,56,80,107,34,93,44,32,34,109,105,110,95,98,108,111,99,107,34,58,32,91,49,49,50,52,52,52,51,44,32,34,72,101,72,89,89,111,65,107,82,73,75,119,74,90,98,95,112,110,116,50,72,120,122,80,114,80,69,120,106,90,57,85,66,49,109,81,102,85,113,71,57,122,107,70,48,71,65,107,119,97,67,119,55,99,51,77,103,88,112,117,116,100,75,71,34,93,44,32,34,97,112,105,95,116,105,109,101,115,116,97,109,112,34,58,32,49,54,55,55,50,50,48,51,52,57,52,56,53,125,44,32,53,54,51,54,55,49,55,49,56,50,44,32,55,48,52,55,51,56,93,44,32,91,49,44,32,123,34,100,105,116,101,109,34,58,32,91,34,113,79,117,70,50,85,48,102,52,112,49,122,76,108,90,103,88,73,86,48,122,50,54,76,101,81,54,52,72,75,86,95,87,95,89,78,52,81,113,117,95,81,115,34,93,44,32,34,109,105,110,95,98,108,111,99,107,34,58,32,91,49,49,50,52,52,52,51,44,32,34,72,101,72,89,89,111,65,107,82,73,75,119,74,90,98,95,112,110,116,50,72,120,122,80,114,80,69,120,106,90,57,85,66,49,109,81,102,85,113,71,57,122,107,70,48,71,65,107,119,97,67,119,55,99,51,77,103,88,112,117,116,100,75,71,34,93,44,32,34,97,112,105,95,116,105,109,101,115,116,97,109,112,34,58,32,49,54,55,55,50,50,48,51,53,48,52,54,52,125,44,32,53,54,51,55,52,50,49,57,50,48,44,32,49,55,52,50,49,93,44,32,91,45,49,44,32,123,34,99,97,112,116,117,114,101,34,58,32,123,34,100,105,116,101,109,34,58,32,91,34,101,109,99,115,55,79,50,67,73,85,52,81,66,70,68,115,104,56,66,51,57,57,112,114,76,70,77,107,113,52,101,114,98,52,84,75,104,74,108,85,76,81,69,34,93,44,32,34,116,105,109,101,34,58,32,91,49,54,55,55,50,50,48,51,53,48,46,49,57,48,49,52,53,55,93,125,44,32,34,109,105,110,95,98,108,111,99,107,34,58,32,91,49,49,50,52,52,52,51,44,32,34,72,101,72,89,89,111,65,107,82,73,75,119,74,90,98,95,112,110,116,50,72,120,122,80,114,80,69,120,106,90,57,85,66,49,109,81,102,85,113,71,57,122,107,70,48,71,65,107,119,97,67,119,55,99,51,77,103,88,112,117,116,100,75,71,34,93,44,32,34,97,112,105,95,116,105,109,101,115,116,97,109,112,34,58,32,49,54,55,55,50,50,48,51,53,49,51,52,52,44,32,34,100,114,111,112,112,101,100,34,58,32,110,117,108,108,125,44,32,53,54,51,55,52,51,57,51,52,49,44,32,49,55,51,56,55,93,93>>,
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I move this into a file?

{ok, _, TXheader} = deserialize_header(Binary),
?assertEqual([], TXheader#tx.tags).
31 changes: 21 additions & 10 deletions src/dev_copycat_arweave.erl
Original file line number Diff line number Diff line change
Expand Up @@ -537,24 +537,35 @@ index_ids_test_parallel() ->
assert_item_read(
<<"bXEgFm4K2b5VD64skBNAlS3I__4qxlM3Sm4Z5IXj3h8">>,
Opts),
assert_bundle_read(
<<"c2ATDuTgwKCcHpAFZqSt13NC-tA4hdA7Aa2xBPuOzoE">>,
[
{<<"OBKr-7UrmjxFD-h-qP-XLuvCgtyuO_IDpBMgIytvusA">>, <<"1">>}
],
Opts
),
ok.

index_unsupported_tx_test_parallel() ->
{_TestStore, StoreOpts, Opts} = setup_index_opts(),
BlockHeight = 1774740,
BlockHeightBin = integer_to_binary(BlockHeight),
{ok, BlockHeight} =
hb_ao:resolve(
<<"~copycat@1.0/arweave&from=", BlockHeightBin/binary,"&to=", BlockHeightBin/binary>>,
Opts
),
% Another bundle with an unsupported avro codec should be indexed even if
% it can't be deserialized.
?assertException(
error,
{badmatch,<<"\"address\":\"0x124e64C9Ed898d4A8B130F6ACb76b33E21CD711c\"", _/binary>>},
{badmatch, {-5125, _}},
hb_store_arweave:read(
StoreOpts,
#{ <<"read">> => <<"kK67S13W_8jM9JUw2umVamo0zh9v1DeVxWrru2evNco">> },
#{ <<"read">> => <<"S6FB8v4gliQNcam2hEQM36xtWdgcD-fPIyjL2Otjcns">> },
Opts)
),
assert_bundle_read(
<<"c2ATDuTgwKCcHpAFZqSt13NC-tA4hdA7Aa2xBPuOzoE">>,
[
{<<"OBKr-7UrmjxFD-h-qP-XLuvCgtyuO_IDpBMgIytvusA">>, <<"1">>}
],
Opts
),
ok.
ok.
Comment on lines +562 to +568
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still have this one failing to be addressed later.


%% @doc Test a bundle header that fits in a single chunk.
small_bundle_header_test_parallel() ->
Expand Down