From 39cf1c10d9551c4af216e9b72094fbe4700371f1 Mon Sep 17 00:00:00 2001 From: nsz Date: Sun, 13 Nov 2011 20:04:54 +0100 Subject: [PATCH] extend cert with server and notes --- document/document.go | 4 +++- document/document_test.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/document/document.go b/document/document.go index afbe31c..c550619 100644 --- a/document/document.go +++ b/document/document.go @@ -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) { diff --git a/document/document_test.go b/document/document_test.go index 8c3413e..72f907b 100644 --- a/document/document_test.go +++ b/document/document_test.go @@ -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 ` -- 2.20.1