@@ -43,15 +43,20 @@ type TransactionMetadatum interface {
4343}
4444
4545type MetaInt struct { Value int64 }
46+
4647type MetaBytes struct { Value []byte }
48+
4749type MetaText struct { Value string }
50+
4851type MetaList struct {
4952 Items []TransactionMetadatum
5053}
54+
5155type MetaPair struct {
5256 Key TransactionMetadatum
5357 Value TransactionMetadatum
5458}
59+
5560type MetaMap struct {
5661 Pairs []MetaPair
5762}
@@ -136,7 +141,7 @@ func DecodeMetadatumRaw(b []byte) (TransactionMetadatum, error) {
136141func decodeMapUint (b []byte ) (TransactionMetadatum , bool , error ) {
137142 var m map [uint ]cbor.RawMessage
138143 if _ , err := cbor .Decode (b , & m ); err != nil {
139- return nil , false , nil // not this shape
144+ return nil , false , nil //nolint:nilerr // not this shape
140145 }
141146 pairs := make ([]MetaPair , 0 , len (m ))
142147 for k , rv := range m {
@@ -155,7 +160,7 @@ func decodeMapUint(b []byte) (TransactionMetadatum, bool, error) {
155160func decodeMapText (b []byte ) (TransactionMetadatum , bool , error ) {
156161 var m map [string ]cbor.RawMessage
157162 if _ , err := cbor .Decode (b , & m ); err != nil {
158- return nil , false , nil // not this shape
163+ return nil , false , nil //nolint:nilerr // not this shape
159164 }
160165 pairs := make ([]MetaPair , 0 , len (m ))
161166 for k , rv := range m {
@@ -171,7 +176,7 @@ func decodeMapText(b []byte) (TransactionMetadatum, bool, error) {
171176func decodeMapBytes (b []byte ) (TransactionMetadatum , bool , error ) {
172177 var m map [cbor.ByteString ]cbor.RawMessage
173178 if _ , err := cbor .Decode (b , & m ); err != nil {
174- return nil , false , nil
179+ return nil , false , nil //nolint:nilerr // not this shape
175180 }
176181 pairs := make ([]MetaPair , 0 , len (m ))
177182 for k , rv := range m {
0 commit comments