Commit d8dcab83 authored by mdj33's avatar mdj33 Committed by vipwzw

rename wallet.proto

parent af17a90f
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.26.0 // protoc-gen-go v1.23.0
// protoc v3.9.1 // protoc v3.9.1
// source: cryptokey.proto // source: cryptokey.proto
package types package types
import ( import (
reflect "reflect" proto "github.com/golang/protobuf/proto"
sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
) )
const ( const (
...@@ -21,6 +21,10 @@ const ( ...@@ -21,6 +21,10 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
) )
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
//DH one time pubkey with secret //DH one time pubkey with secret
type DHSecret struct { type DHSecret struct {
state protoimpl.MessageState state protoimpl.MessageState
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.26.0 // protoc-gen-go v1.23.0
// protoc v3.9.1 // protoc v3.9.1
// source: merkletree.proto // source: merkletree.proto
package types package types
import ( import (
reflect "reflect" proto "github.com/golang/protobuf/proto"
sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
) )
const ( const (
...@@ -21,6 +21,10 @@ const ( ...@@ -21,6 +21,10 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
) )
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
//子树用高度和hash描述,2^10=1024个叶子节点,子树高度不会超过10 //子树用高度和hash描述,2^10=1024个叶子节点,子树高度不会超过10
type CommitSubTree struct { type CommitSubTree struct {
state protoimpl.MessageState state protoimpl.MessageState
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.26.0 // protoc-gen-go v1.23.0
// protoc v3.9.1 // protoc v3.9.1
// source: mix.proto // source: mix.proto
package types package types
import ( import (
reflect "reflect" proto "github.com/golang/protobuf/proto"
sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
) )
const ( const (
...@@ -21,6 +21,10 @@ const ( ...@@ -21,6 +21,10 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
) )
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
//区分不同的验证电路 //区分不同的验证电路
type VerifyType int32 type VerifyType int32
......
...@@ -20,7 +20,7 @@ func TestNewPrivacyWithPrivKey(t *testing.T) { ...@@ -20,7 +20,7 @@ func TestNewPrivacyWithPrivKey(t *testing.T) {
pairs := newPrivacyKey(keyByte) pairs := newPrivacyKey(keyByte)
t.Log("payPri", pairs.PaymentKey.SpendKey, "payPub", pairs.PaymentKey.ReceiveKey) t.Log("payPri", pairs.PaymentKey.SpendKey, "payPub", pairs.PaymentKey.ReceiveKey)
t.Log("crytoPub", pairs.EncryptKey.PubKey, "crytoPri", pairs.EncryptKey.PrivKey) t.Log("crytoPub", pairs.SecretKey.SecretPubKey, "crytoPri", pairs.SecretKey.SecretPrivKey)
//prikey2 := "1257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01" //prikey2 := "1257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01"
//keyByte2, err := hex.DecodeString(prikey2) //keyByte2, err := hex.DecodeString(prikey2)
...@@ -37,11 +37,11 @@ func TestNewPrivacyWithPrivKey(t *testing.T) { ...@@ -37,11 +37,11 @@ func TestNewPrivacyWithPrivKey(t *testing.T) {
Amount: "28242048", Amount: "28242048",
} }
data, err := encryptData(pairs.EncryptKey.PubKey, types.Encode(secret1)) data, err := encryptData(pairs.SecretKey.SecretPubKey, types.Encode(secret1))
assert.Nil(t, err) assert.Nil(t, err)
crypData, err := common.FromHex(data.Secret) crypData, err := common.FromHex(data.Secret)
assert.Nil(t, err) assert.Nil(t, err)
decryData1, err := decryptData(pairs.EncryptKey.PrivKey, data.OneTimePubKey, crypData) decryData1, err := decryptData(pairs.SecretKey.SecretPrivKey, data.OneTimePubKey, crypData)
assert.Nil(t, err) assert.Nil(t, err)
var val mixTy.SecretData var val mixTy.SecretData
err = types.Decode(decryData1, &val) err = types.Decode(decryData1, &val)
...@@ -94,14 +94,14 @@ func TestEncodeSecretData(t *testing.T) { ...@@ -94,14 +94,14 @@ func TestEncodeSecretData(t *testing.T) {
hexRet := hex.EncodeToString(ret) hexRet := hex.EncodeToString(ret)
//assert.Nil(t,err) //assert.Nil(t,err)
req := &mixTy.EncryptSecretData{PeerKey: privacy.EncryptKey.PubKey, Secret: hexRet} req := &mixTy.EncryptSecretData{PeerSecretPubKey: privacy.SecretKey.SecretPubKey, Secret: hexRet}
dhSecret, err := encryptSecretData(req) dhSecret, err := encryptSecretData(req)
assert.Nil(t, err) assert.Nil(t, err)
//t.Log(dhSecret) //t.Log(dhSecret)
data, err := common.FromHex(dhSecret.Secret) data, err := common.FromHex(dhSecret.Secret)
assert.Nil(t, err) assert.Nil(t, err)
rawData, err := decryptData(privacy.EncryptKey.PrivKey, dhSecret.OneTimePubKey, data) rawData, err := decryptData(privacy.SecretKey.SecretPrivKey, dhSecret.OneTimePubKey, data)
assert.Nil(t, err) assert.Nil(t, err)
var rawSecret mixTy.SecretData var rawSecret mixTy.SecretData
types.Decode(rawData, &rawSecret) types.Decode(rawData, &rawSecret)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment