Skip to content

Commit

Permalink
rename pvl types
Browse files Browse the repository at this point in the history
  • Loading branch information
mlsteele committed Sep 1, 2016
1 parent 5f0bfff commit 9866d07
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 76 deletions.
4 changes: 2 additions & 2 deletions go/pvl/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ func (ctx *ProofContextExtImpl) GetLogPvl() logger.Logger {
return ctx.pvlLogger
}

func debugWithState(g ProofContextExt, state PvlScriptState, format string, arg ...interface{}) {
func debugWithState(g ProofContextExt, state ScriptState, format string, arg ...interface{}) {
s := fmt.Sprintf(format, arg...)
g.GetLogPvl().Debug("PVL @(service:%v script:%v pc:%v) %v",
debugServiceToString(state.Service), state.WhichScript, state.PC, s)
}

func debugWithStateError(g ProofContextExt, state PvlScriptState, err libkb.ProofError) {
func debugWithStateError(g ProofContextExt, state ScriptState, err libkb.ProofError) {
g.GetLogPvl().Debug("PVL @(service:%v script:%v pc:%v) Error code=%v: %v",
debugServiceToString(state.Service), state.WhichScript, state.PC, err.GetProofStatus(), err.GetDesc())
}
Expand Down
4 changes: 2 additions & 2 deletions go/pvl/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
// Only substitutes whitelisted variables.
// It is an error to refer to an unknown variable or undefined numbered group.
// Match is an optional slice which is a regex match.
func substitute(template string, state PvlScriptState, match []string) (string, libkb.ProofError) {
func substitute(template string, state ScriptState, match []string) (string, libkb.ProofError) {
vars := state.Vars
webish := (state.Service == keybase1.ProofType_DNS || state.Service == keybase1.ProofType_GENERIC_WEB_SITE)

Expand Down Expand Up @@ -94,7 +94,7 @@ func jsonHasKey(w *jsonw.Wrapper, key string) bool {
return !w.AtKey(key).IsNil()
}

func jsonHasKeyCommand(w *jsonw.Wrapper, key PvlCommandName) bool {
func jsonHasKeyCommand(w *jsonw.Wrapper, key CommandName) bool {
return !w.AtKey(string(key)).IsNil()
}

Expand Down
8 changes: 4 additions & 4 deletions go/pvl/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
jsonw "github.com/keybase/go-jsonw"
)

func sampleState() PvlScriptState {
var sampleVars = PvlScriptVariables{
func sampleState() ScriptState {
var sampleVars = ScriptVariables{
UsernameService: "kronk",
UsernameKeybase: "kronk_on_kb",
Sig: []byte{1, 2, 3, 4, 5},
Expand All @@ -25,7 +25,7 @@ func sampleState() PvlScriptState {
Hostname: "%{sig_id_medium}",
}

var sampleState = PvlScriptState{
var sampleState = ScriptState{
WhichScript: 0,
PC: 0,
Service: keybase1.ProofType_TWITTER,
Expand Down Expand Up @@ -84,7 +84,7 @@ func TestPvlJSONHasKey(t *testing.T) {
if jsonHasKey(test.json, test.key) != test.has {
t.Fatalf("%v %v", i, !test.has)
}
if jsonHasKeyCommand(test.json, PvlCommandName(test.key)) != test.has {
if jsonHasKeyCommand(test.json, CommandName(test.key)) != test.has {
t.Fatalf("%v %v", i, !test.has)
}
}
Expand Down
Loading

0 comments on commit 9866d07

Please sign in to comment.