From 5e7098f6baf52a11acc05ad74593d7cc60800d75 Mon Sep 17 00:00:00 2001 From: Ryan Schneider Date: Fri, 6 Dec 2024 09:10:35 -0800 Subject: [PATCH 1/2] Update primitive.yaml: Add Bytes primitive Useful for expressing an arbitrary sequence of bytes. --- types/primitive.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/types/primitive.yaml b/types/primitive.yaml index 96c1fc60..90675522 100644 --- a/types/primitive.yaml +++ b/types/primitive.yaml @@ -90,6 +90,13 @@ Bitvector: example: "0x01" pattern: "^0x[a-fA-F0-9]{2,}$" +Bytes: + type: string + format: hex + description: "An arbitrary-length sequence of bytes" + example: "0x02a94f5374fce5edbc8e2a8697c15331677e6ebf0b85103a5617937691dfeeb89b86a80d5dc9e3c9d3a1a0e7ce311e26e0bb732eabaa47ffa288f0d54de28209a62a7d29d098daeed734da114470da559bd4b4c7259e1f7952555241dcbc90cf194a2ef676fc6005f3672fada2a3645edb297a7553" + pattern: "^0x[a-fA-F0-9]{2,}$" + Uint8: type: string description: "Unsigned 8 bit integer, max value 255" From c4286721e4287271a7766aa258318704ddd9a197 Mon Sep 17 00:00:00 2001 From: Ryan Schneider Date: Fri, 6 Dec 2024 10:19:51 -0800 Subject: [PATCH 2/2] fixup: update Bytes regex to hex pairs. --- types/primitive.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/primitive.yaml b/types/primitive.yaml index 90675522..1195d3fe 100644 --- a/types/primitive.yaml +++ b/types/primitive.yaml @@ -95,7 +95,7 @@ Bytes: format: hex description: "An arbitrary-length sequence of bytes" example: "0x02a94f5374fce5edbc8e2a8697c15331677e6ebf0b85103a5617937691dfeeb89b86a80d5dc9e3c9d3a1a0e7ce311e26e0bb732eabaa47ffa288f0d54de28209a62a7d29d098daeed734da114470da559bd4b4c7259e1f7952555241dcbc90cf194a2ef676fc6005f3672fada2a3645edb297a7553" - pattern: "^0x[a-fA-F0-9]{2,}$" + pattern: "^0x([0-9a-fA-F][0-9a-fA-F])+$" Uint8: type: string