-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added
BorshSchema
impl for store::TreeMap<K, V, H>
and `Uno…
…rderedSet<T, H>` (#1213)
- Loading branch information
Showing
4 changed files
with
295 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
122 changes: 122 additions & 0 deletions
122
near-sdk/src/store/tree_map/snapshots/near_sdk__store__tree_map__tests__borsh_schema.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
--- | ||
source: near-sdk/src/store/tree_map/mod.rs | ||
expression: "format!(\"{:#?}\", defs)" | ||
--- | ||
{ | ||
"()": Primitive( | ||
0, | ||
), | ||
"FreeList": Struct { | ||
fields: NamedFields( | ||
[ | ||
( | ||
"first_free", | ||
"Option<FreeListIndex>", | ||
), | ||
( | ||
"occupied_count", | ||
"u32", | ||
), | ||
( | ||
"elements", | ||
"Vector", | ||
), | ||
], | ||
), | ||
}, | ||
"FreeListIndex": Struct { | ||
fields: UnnamedFields( | ||
[ | ||
"u32", | ||
], | ||
), | ||
}, | ||
"IndexMap": Struct { | ||
fields: NamedFields( | ||
[ | ||
( | ||
"prefix", | ||
"Vec<u8>", | ||
), | ||
], | ||
), | ||
}, | ||
"LookupMap": Struct { | ||
fields: NamedFields( | ||
[ | ||
( | ||
"prefix", | ||
"Vec<u8>", | ||
), | ||
], | ||
), | ||
}, | ||
"Option<FreeListIndex>": Enum { | ||
tag_width: 1, | ||
variants: [ | ||
( | ||
0, | ||
"None", | ||
"()", | ||
), | ||
( | ||
1, | ||
"Some", | ||
"FreeListIndex", | ||
), | ||
], | ||
}, | ||
"Tree": Struct { | ||
fields: NamedFields( | ||
[ | ||
( | ||
"root", | ||
"Option<FreeListIndex>", | ||
), | ||
( | ||
"nodes", | ||
"FreeList", | ||
), | ||
], | ||
), | ||
}, | ||
"TreeMap": Struct { | ||
fields: NamedFields( | ||
[ | ||
( | ||
"values", | ||
"LookupMap", | ||
), | ||
( | ||
"tree", | ||
"Tree", | ||
), | ||
], | ||
), | ||
}, | ||
"Vec<u8>": Sequence { | ||
length_width: 4, | ||
length_range: 0..=4294967295, | ||
elements: "u8", | ||
}, | ||
"Vector": Struct { | ||
fields: NamedFields( | ||
[ | ||
( | ||
"len", | ||
"u32", | ||
), | ||
( | ||
"values", | ||
"IndexMap", | ||
), | ||
], | ||
), | ||
}, | ||
"u32": Primitive( | ||
4, | ||
), | ||
"u8": Primitive( | ||
1, | ||
), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
...rc/store/unordered_set/snapshots/near_sdk__store__unordered_set__tests__borsh_schema.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
--- | ||
source: near-sdk/src/store/unordered_set/mod.rs | ||
expression: "format!(\"{:#?}\", defs)" | ||
--- | ||
{ | ||
"()": Primitive( | ||
0, | ||
), | ||
"FreeList": Struct { | ||
fields: NamedFields( | ||
[ | ||
( | ||
"first_free", | ||
"Option<FreeListIndex>", | ||
), | ||
( | ||
"occupied_count", | ||
"u32", | ||
), | ||
( | ||
"elements", | ||
"Vector", | ||
), | ||
], | ||
), | ||
}, | ||
"FreeListIndex": Struct { | ||
fields: UnnamedFields( | ||
[ | ||
"u32", | ||
], | ||
), | ||
}, | ||
"IndexMap": Struct { | ||
fields: NamedFields( | ||
[ | ||
( | ||
"prefix", | ||
"Vec<u8>", | ||
), | ||
], | ||
), | ||
}, | ||
"LookupMap": Struct { | ||
fields: NamedFields( | ||
[ | ||
( | ||
"prefix", | ||
"Vec<u8>", | ||
), | ||
], | ||
), | ||
}, | ||
"Option<FreeListIndex>": Enum { | ||
tag_width: 1, | ||
variants: [ | ||
( | ||
0, | ||
"None", | ||
"()", | ||
), | ||
( | ||
1, | ||
"Some", | ||
"FreeListIndex", | ||
), | ||
], | ||
}, | ||
"UnorderedSet": Struct { | ||
fields: NamedFields( | ||
[ | ||
( | ||
"elements", | ||
"FreeList", | ||
), | ||
( | ||
"index", | ||
"LookupMap", | ||
), | ||
], | ||
), | ||
}, | ||
"Vec<u8>": Sequence { | ||
length_width: 4, | ||
length_range: 0..=4294967295, | ||
elements: "u8", | ||
}, | ||
"Vector": Struct { | ||
fields: NamedFields( | ||
[ | ||
( | ||
"len", | ||
"u32", | ||
), | ||
( | ||
"values", | ||
"IndexMap", | ||
), | ||
], | ||
), | ||
}, | ||
"u32": Primitive( | ||
4, | ||
), | ||
"u8": Primitive( | ||
1, | ||
), | ||
} |