Skip to content

Commit bf8270f

Browse files
committed
Cleanup
1 parent a4935f0 commit bf8270f

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

wallet/interfaces.go

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ import (
1515

1616
// Certificate represents a basic certificate in the wallet
1717
type Certificate struct {
18-
Type Base64Bytes32 `json:"type"` // Base64-encoded certificate type ID
19-
SerialNumber Base64Bytes32 `json:"serialNumber"` // Base64-encoded unique serial number
20-
Subject *ec.PublicKey `json:"subject"` // Public key of the certificate subject
21-
Certifier *ec.PublicKey `json:"certifier"` // Public key of the certificate issuer
22-
RevocationOutpoint *Outpoint `json:"revocationOutpoint,omitempty"` // Format: "txid:outputIndex"
23-
Fields map[string]string `json:"fields,omitempty"` // Field name -> field value (encrypted)
24-
Signature JSONByteHex `json:"signature,omitempty"` // Hex-encoded signature
18+
Type Base64Bytes32 `json:"type"`
19+
SerialNumber Base64Bytes32 `json:"serialNumber"`
20+
Subject *ec.PublicKey `json:"subject"`
21+
Certifier *ec.PublicKey `json:"certifier"`
22+
RevocationOutpoint *Outpoint `json:"revocationOutpoint,omitempty"`
23+
Fields map[string]string `json:"fields,omitempty"` // Field name -> field value (encrypted)
24+
Signature JSONByteHex `json:"signature,omitempty"`
2525
}
2626

2727
// MarshalJSON implements json.Marshaler interface for Certificate
@@ -37,7 +37,7 @@ func (c *Certificate) MarshalJSON() ([]byte, error) {
3737
certifierHex = &cs
3838
}
3939

40-
res, err := json.Marshal(&struct {
40+
return json.Marshal(&struct {
4141
Subject *string `json:"subject"`
4242
Certifier *string `json:"certifier"`
4343
*Alias
@@ -46,7 +46,6 @@ func (c *Certificate) MarshalJSON() ([]byte, error) {
4646
Certifier: certifierHex,
4747
Alias: (*Alias)(c),
4848
})
49-
return res, err
5049
}
5150

5251
// UnmarshalJSON implements json.Unmarshaler interface for Certificate
@@ -185,8 +184,8 @@ type SignActionOptions struct {
185184

186185
// SignActionArgs contains data needed to sign a previously created transaction.
187186
type SignActionArgs struct {
188-
Reference []byte `json:"reference"` // Base64 encoded
189-
Spends map[uint32]SignActionSpend `json:"spends"` // Key is input index
187+
Reference []byte `json:"reference"`
188+
Spends map[uint32]SignActionSpend `json:"spends"` // Key is input index
190189
Options *SignActionOptions `json:"options,omitempty"`
191190
}
192191

@@ -372,7 +371,7 @@ type Interface interface {
372371

373372
// AbortActionArgs identifies a transaction to abort using its reference string.
374373
type AbortActionArgs struct {
375-
Reference []byte `json:"reference"` // Base64 encoded reference
374+
Reference []byte `json:"reference"`
376375
}
377376

378377
// AbortActionResult confirms whether a transaction was successfully aborted.
@@ -624,13 +623,6 @@ type AcquireCertificateArgs struct {
624623
PrivilegedReason string `json:"privilegedReason,omitempty"`
625624
}
626625

627-
func (a *AcquireCertificateArgs) RevocationOutpointString() string {
628-
if a.RevocationOutpoint == nil {
629-
return ""
630-
}
631-
return a.RevocationOutpoint.String()
632-
}
633-
634626
type ListCertificatesArgs struct {
635627
Certifiers []HexBytes33 `json:"certifiers"`
636628
Types []Base64Bytes32 `json:"types"`

0 commit comments

Comments
 (0)