Cleaned up test

This commit is contained in:
David Vennik
2022-12-27 12:27:13 +00:00
parent b81844a7a1
commit f97f30ad29
3 changed files with 8 additions and 13 deletions

View File

@@ -41,7 +41,6 @@ func PeelOnion(b slice.Bytes, c *slice.Cursor) (on types.Onion, e error) {
}
on = o
case confirmation.MagicString:
log.I.S("confirmation")
o := &confirmation.OnionSkin{}
if e = o.Decode(b, c); check(e) {
return

View File

@@ -201,16 +201,13 @@ func TestOnionSkins_Layer(t *testing.T) {
log2.CodeLoc = true
var e error
n := nonce.NewID()
log.I.S("confirmation nonce", n)
prv1, prv2 := GetTwoPrvKeys(t)
pub1 := pub.Derive(prv1)
// log.I.S(pub1.ToBytes(), prv1.ToBytes())
on := OnionSkins{}.
OnionSkin(address.FromPubKey(pub1), prv2).
Confirmation(n).
Assemble()
onb := EncodeOnion(on)
// log.I.S(onb.ToBytes())
c := slice.NewCursor()
var onos, onc types.Onion
if onos, e = PeelOnion(onb, c); check(e) {
@@ -223,22 +220,21 @@ func TestOnionSkins_Layer(t *testing.T) {
t.Error("did not unwrap expected type")
t.FailNow()
}
// log.I.S(os.FromPub.ToBytes(), os.Cloak, os.Nonce)
log.I.S(onb[*c:].ToBytes())
os.Decrypt(prv1, onb, c)
log.I.S(onb[*c:].ToBytes())
// unwrap the confirmation
if onc, e = PeelOnion(onb, c); check(e) {
t.Error(e)
t.FailNow()
}
log.I.S(reflect.TypeOf(onc))
oc := &confirmation.OnionSkin{}
if oc, ok = onc.(*confirmation.OnionSkin); !ok {
t.Error("did not unwrap expected type")
t.FailNow()
}
log.I.S(oc)
if oc.ID != n {
t.Error("did not recover the confirmation nonce")
t.FailNow()
}
}
func TestOnionSkins_Purchase(t *testing.T) {

View File

@@ -10,11 +10,11 @@ var (
// GitRef is the gitref, as in refs/heads/branchname.
GitRef = "refs/heads/main"
// ParentGitCommit is the commit hash of the parent HEAD.
ParentGitCommit = "0fba69ad52595df91c8269247c78567dcea9985b"
ParentGitCommit = "f28a26ba8f93a306617a498ce6a3a4f033ea9c35"
// BuildTime stores the time when the current binary was built.
BuildTime = "2022-12-27T12:17:28Z"
BuildTime = "2022-12-27T12:27:13Z"
// SemVer lists the (latest) git tag on the build.
SemVer = "v0.0.237"
SemVer = "v0.0.238"
// PathBase is the path base returned from runtime caller.
PathBase = "/home/loki/src/github.com/Indra-Labs/indra/"
// Major is the major number from the tag.
@@ -22,7 +22,7 @@ var (
// Minor is the minor number from the tag.
Minor = 0
// Patch is the patch version number from the tag.
Patch = 237
Patch = 238
)
// Version returns a pretty printed version information string.