Skip to content

Commit

Permalink
add types enum
Browse files Browse the repository at this point in the history
  • Loading branch information
rohenaz committed Sep 24, 2020
1 parent 7555668 commit cf63bda
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions bap.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ import (
// Prefix is the bitcom prefix for Bitcoin Attestation Protocol
const Prefix = "1BAPSuaPnfGnSBM3GLV9yhxUdYe4vGbdMT"

// Types is an enum for Bap Type Constants
type Types string

// Bap Type Constants
const (
ID = "ID"
REVOKE = "REVOKE"
ATTEST = "ATTEST"
ID Types = "ID"
REVOKE Types = "REVOKE"
ATTEST Types = "ATTEST"
)

// {
Expand Down Expand Up @@ -100,9 +103,10 @@ func New() *Data {

// FromTape takes a BOB Tape and returns a Bap data structure
func (b *Data) FromTape(tape bob.Tape) {

b.Type = tape.Cell[1].S

switch b.Type {
switch Types(b.Type) {
case ATTEST:
fallthrough
case REVOKE:
Expand Down

0 comments on commit cf63bda

Please sign in to comment.