extend cert with server and notes
authornsz <nsz@port70.net>
Sun, 13 Nov 2011 19:04:54 +0000 (20:04 +0100)
committernsz <nsz@port70.net>
Sun, 13 Nov 2011 19:04:54 +0000 (20:04 +0100)
document/document.go
document/document_test.go

index afbe31c..c550619 100644 (file)
@@ -77,6 +77,7 @@ type Cert struct {
        Date             int64  `marshal:"date"` // date of issue
        Balance          int64  // current obligation value
        Denomination     string
+       Server           string   `marshal:"id"`                 // ID of the server
        Issuer           string   `marshal:"id"`                 // ID of the obligation issuer (drawee?)
        LastDebitSerial  uint32   `key:"Last-Debit-Serial"`      // serial of the last draft cert or 0
        LastCreditSerial uint32   `key:"Last-Credit-Serial"`     // serial of the last credit cert or 0
@@ -86,7 +87,8 @@ type Cert struct {
        Drawer           string   `marshal:"id"`                   // ID of the drawer in the transaction
        DrawerSerial     uint32   `key:"Drawer-Serial"`            // serial of the drawer's related debit cert
        DrawerCert       string   `marshal:"id" key:"Drawer-Cert"` // ID of the drawer's related debit cert
-       References       []string `marshal:"idlist"`               // cert IDs for timestamping the system
+       Notes            string   // Arbitrary text notes of the server (signer)
+       References       []string `marshal:"idlist"` // cert IDs for timestamping the system
 }
 
 func DecodeClearSigned(s []byte) (c *ClearSigned, err error) {
index 8c3413e..72f907b 100644 (file)
@@ -163,11 +163,12 @@ func TestDraft(t *testing.T) {
 
 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
+Server: 000000000000000000000000000000000000000A
 Issuer: 000000000000000000000000000000000000000B
 Last-Debit-Serial: 0
 Last-Credit-Serial: 12
@@ -177,6 +178,7 @@ Draft: 000000000000000000000000000000000000000D
 Drawer: 000000000000000000000000000000000000000E
 Drawer-Serial: 2
 Drawer-Cert: 000000000000000000000000000000000000000F
+Notes: -
 References: 000000000000000000000000000000000000000C 000000000000000000000000000000000000000F
 `