func TestClearSigned(t *testing.T) {
for _, x := range testData {
- c, err := DecodeClearSigned(x.D)
+ c, err := ParseClearSigned(x.D)
if err != nil {
t.Errorf("decoding %#v failed: %s\n", x.D, err)
continue
}
}
for _, x := range testData {
- d, err := EncodeClearSigned(x.C)
+ d, err := FormatClearSigned(x.C)
if err != nil {
t.Errorf("encoding %#v failed: %s\n", x.C, err)
continue
Beneficiary: 000000000000000000000000000000000000000B
Amount: 1
Denomination: half euro
-Issue-Date: 2011-11-13T12:20:35Z
-Maturity-Date: 2011-12-27T09:18:46Z
+Issuer: 000000000000000000000000000000000000000D
+Authorized-By: 000000000000000000000000000000000000000C
+Date: 2011-11-13T12:20:35Z
+Maturity-Date: 2011-11-13T12:20:35Z
+Expiry-Date: 2011-12-27T09:18:46Z
Notes: some notes
Nonce: 42
-Server: 000000000000000000000000000000000000000C
-Drawee: 000000000000000000000000000000000000000D
`
func TestDraft(t *testing.T) {
t.Errorf("ParseDraft failed: %s\n", err)
return
}
- s, err := RenderDraft(d)
+ s, err := FormatDraft(d)
if err != nil {
t.Errorf("render %v draft failed: %s\n", d, err)
}
const certBody = `Content-Type: text/plain.epoint.cert; charset=utf-8
-Holder: 000000000000000000000000000000000000000A
+Holder: 0000000000000000000000000000000000000009
Serial: 13
Date: 2011-11-01T10:29:38Z
Balance: 23
Denomination: half euro
Issuer: 000000000000000000000000000000000000000B
+Authorized-By: 000000000000000000000000000000000000000A
Last-Debit-Serial: 0
Last-Credit-Serial: 12
Last-Cert: 000000000000000000000000000000000000000C
Difference: 1
Draft: 000000000000000000000000000000000000000D
Drawer: 000000000000000000000000000000000000000E
-Drawer-Serial: 2
Drawer-Cert: 000000000000000000000000000000000000000F
+Notes: -
References: 000000000000000000000000000000000000000C 000000000000000000000000000000000000000F
`
t.Errorf("ParseCert failed: %s\n", err)
return
}
- s, err := RenderCert(c)
+ s, err := FormatCert(c)
if err != nil {
t.Errorf("render %v cert failed: %s\n", c, err)
}