Skip to content

Commit d681ee7

Browse files
committed
Changed known value 'hasName' to 'name'
1 parent 0d330ac commit d681ee7

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

MANUAL.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ envelope format ur:envelope/lptpsogdnewfoxdskotbemhymofsuojefmfdhlryoyadcsspoybd
396396
Bytes(16) [
397397
'isA': 'Seed'
398398
'date': 2024-07-03T00:38:20Z
399-
'hasName': "Blockchain Commons petty cash"
399+
'name': "Blockchain Commons petty cash"
400400
'note': "Meant to hold no more than $500, for payment of minor costs"
401401
]
402402
```
@@ -531,7 +531,7 @@ $ envelope format $ENVSEED
531531
Bytes(16) [
532532
'isA': 'Seed'
533533
'date': 2024-07-02T22:42:54Z
534-
'hasName': "Blockchain Commons 128-Bit Default Seed"
534+
'name': "Blockchain Commons 128-Bit Default Seed"
535535
'note': "This is the 128-bit example key for Blockchain Commons. Do not use it for real funds!"
536536
]
537537
```
@@ -559,7 +559,7 @@ Because assertions (which includes encryption) are applied to a subject, this mo
559559
ENCRYPTED [
560560
'isA': 'Seed'
561561
'date': 2024-07-02T22:42:54Z
562-
'hasName': "Blockchain Commons 128-Bit Default Seed"
562+
'name': "Blockchain Commons 128-Bit Default Seed"
563563
'note': "This is the 128-bit example key for Blockchain Commons. Do not use it for real funds!"
564564
]
565565
```

USAGE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ $ envelope format ur:envelope/lptpsogddezsdmjosscylolpettysbeetkjsrykpoyadcsspoy
7272
Bytes(16) [
7373
'isA': 'Seed'
7474
'date': 2024-07-01
75-
'hasName': "My Seed"
75+
'name': "My Seed"
7676
'note': "This is a note"
7777
]
7878
```

src/seed.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl From<Seed> for Envelope {
120120
.add_optional_assertion(known_values::DATE, seed.creation_date().cloned());
121121

122122
if !seed.name().is_empty() {
123-
e = e.add_assertion(known_values::HAS_NAME, seed.name());
123+
e = e.add_assertion(known_values::NAME, seed.name());
124124
}
125125

126126
if !seed.note().is_empty() {
@@ -137,7 +137,7 @@ impl TryFrom<Envelope> for Seed {
137137
fn try_from(envelope: Envelope) -> Result<Self> {
138138
envelope.check_type(&known_values::SEED_TYPE)?;
139139
let data = envelope.subject().try_leaf()?.try_into_byte_string()?.to_vec();
140-
let name = envelope.extract_optional_object_for_predicate::<String>(known_values::HAS_NAME)?.unwrap_or_default().to_string();
140+
let name = envelope.extract_optional_object_for_predicate::<String>(known_values::NAME)?.unwrap_or_default().to_string();
141141
let note = envelope.extract_optional_object_for_predicate::<String>(known_values::NOTE)?.unwrap_or_default().to_string();
142142
let creation_date = envelope.extract_optional_object_for_predicate::<dcbor::Date>(known_values::DATE)?.map(|s| s.as_ref().clone());
143143
Ok(Self::new_opt(data, name, note, creation_date))

tests/tests.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fn test_seed_2() -> Result<()> {
2424
#[test]
2525
fn test_formats() -> Result<()> {
2626
bc_envelope::register_tags();
27-
27+
2828
let hex = "9d347f841a4e2ce6bc886e1aee74d824";
2929

3030
// Most format types are not round-trippable
@@ -132,7 +132,7 @@ fn test_envelope() -> Result<()> {
132132
Bytes(16) [
133133
'isA': 'Seed'
134134
'date': 2024-06-15T01:02:00Z
135-
'hasName': "Dark Purple Aqua Love"
135+
'name': "Dark Purple Aqua Love"
136136
'note': "This is the note"
137137
]
138138
"#

0 commit comments

Comments
 (0)