You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A. I describe how to think of attributes and their origins and mappings as a pipeline below. A useful case to think through is a function origin which returns a GeneralisedTime (so we set as=”utf8”), but the attribute syntax is GeneralisedTime (and hence the JavaScript object is expected to be our standard JavaScript GeneralisedTime class).
3
+
A. I describe how to think of attributes and their origins and mappings as a pipeline below. A useful case to think through is a function origin which returns a GeneralisedTime (so we set as="utf8"), but the attribute syntax is GeneralisedTime (and hence the JavaScript object is expected to be our standard JavaScript GeneralisedTime class).
4
4
5
-
B. Based on this, it would be good if we add as=”address”. The matching syntax type should be IA5 String (but Directory String will work too). We can return the JavaScript object as a string or if there’s a suitable syntax that defines it as an address, we can create a simple class to wrap it (in the future?)
5
+
B. Based on this, it would be good if we add as="address". The matching syntax type should be IA5 String (but Directory String will work too). We can return the JavaScript object as a string or if there's a suitable syntax that defines it as an address, we can create a simple class to wrap it (in the future?)
6
6
7
7
C. To preserve precision, Numeric Strings are stored internally as a Big Integer, but returned as a JavaScript string (unless we want to support provide or endorse a big number library. Possibly later?)
8
8
9
9
D. Note that according to https://tools.ietf.org/html/rfc4517#section-3.3.23, Numeric String is:
10
10
11
+
```
11
12
NumericString = 1*(DIGIT / SPACE)
12
13
DIGIT = %x30 / LDIGIT ; "0"-"9"
13
14
LDIGIT = %x31-39 ; "1"-"9"
15
+
```
14
16
15
17
Attribute as a pipeline:
16
18
17
19
One way to look at an attribute type and their origin, and (optional) mapping is as a pipeline of 2 or 3 processing stages.
18
20
19
21
With a mapping:
20
22
21
-
A. Origin output with
22
-
specific type (based on
23
-
Inputs with "as"). Attribute
24
-
specific B. Convert to string to be value with
25
-
types used as mapping's input specific
26
-
─────────────▶ ┌──────────┐ ┌──────────┐ ┌──────────┐ type
* Numeric String => Big Integer internally (and JavaScript string)
86
94
87
-
In <ts:transaction>, I just assume the function is an origin with as=”void” (void is only used internally for internal consistency), so the output (if any) is dropped. In the future if we need to chain function calls (I don’t know if we will ever need to), then it’s just another pipeline of function origins with non-void as=””
95
+
9. This brings some consistency so we can expand the pipeline to more than 3 stages in the future
88
96
89
-
Note while we say the input and output types are typed, TokenScript clients can still hold them internally as strings as long as it knows and can enforce the types they represent. That’s an implementation detail. But such a case (assuming getString() returns a string) should not be permitted:
97
+
10. This is also useful when we have multiple origins which different types within the same attribute type
90
98
99
+
11. In `<ts:transaction>`, I just assume the function is an origin with as="void" (void is only used internally for consistency), so the output (if any) is dropped. In the future if we need to chain function calls (I don't know if we will ever need to), then it's just another pipeline of function origins with non-void as=""
100
+
101
+
12. Note while we say the input and output types are typed, TokenScript clients can still hold them internally as strings as long as it knows and can enforce the types they represent. That's an implementation detail. But such a case (assuming `getString()` returns a string) should not be permitted:
0 commit comments