Commit 9b794a19 authored by madengji's avatar madengji Committed by vipwzw

add unfrozen status

parent b4a6fb77
......@@ -32,11 +32,8 @@ func MixCmd() *cobra.Command {
CreateTransferRawTxCmd(),
CreateWithdrawRawTxCmd(),
CreateAuthRawTxCmd(),
//CreateDepositCmd(),
//CreateTransferCmd(),
//CreateWithdrawCmd(),
CreateConfigCmd(),
//CreateAuthorizeCmd(),
QueryCmd(),
WalletCmd(),
)
......@@ -51,269 +48,6 @@ func getRealExecName(paraName string, name string) string {
}
// CreateDepositCmd create raw asset transfer tx
//func CreateDepositCmd() *cobra.Command {
// cmd := &cobra.Command{
// Use: "deposit",
// Short: "Create a asset deposit to mix coin contract",
// Run: createDeposit,
// }
// addCreateDepositFlags(cmd)
// return cmd
//}
//
//func addCreateDepositFlags(cmd *cobra.Command) {
// cmd.Flags().StringP("proofs", "f", "", "'proof-pubinput' format pair")
// cmd.MarkFlagRequired("proofs")
//
// cmd.Flags().Uint64P("amount", "m", 0, "deposit amount")
// cmd.MarkFlagRequired("amount")
//
// cmd.Flags().StringP("secretReceiver", "p", "", "secret for receiver addr")
// cmd.MarkFlagRequired("secretReceiver")
//
// cmd.Flags().StringP("secretAuth", "a", "", "secret for authorize addr")
//
// cmd.Flags().StringP("secretReturn", "r", "", "secret for return addr")
//
//}
//func parseProofPara(input string) ([]*mixTy.ZkProofInfo, error) {
// var proofInputs []*mixTy.ZkProofInfo
// inputParas := strings.Split(input, ",")
// for _, i := range inputParas {
// inputs := strings.Split(i, "-")
// if len(inputs) != 2 {
// fmt.Println("proofs parameters not correct:", i)
// return nil, types.ErrInvalidParam
// }
// var proofInfo mixTy.ZkProofInfo
// proofInfo.Proof = inputs[0]
// proofInfo.PublicInput = inputs[1]
// proofInputs = append(proofInputs, &proofInfo)
// }
// return proofInputs, nil
//}
//
//func parseProofPara(input string) (*mixTy.ZkProofInfo, error) {
// inputs := strings.Split(input, "-")
// if len(inputs) != 2 {
// fmt.Println("proofs parameters not correct:", input)
// return nil, types.ErrInvalidParam
// }
// var proofInfo mixTy.ZkProofInfo
// proofInfo.Proof = inputs[0]
// proofInfo.PublicInput = inputs[1]
// return &proofInfo, nil
//}
//
//func createDeposit(cmd *cobra.Command, args []string) {
// paraName, _ := cmd.Flags().GetString("paraName")
// //amount, _ := cmd.Flags().GetUint64("amount")
// proofsPara, _ := cmd.Flags().GetString("proofs")
// secretReceiver, _ := cmd.Flags().GetString("secretReceiver")
// secretAuth, _ := cmd.Flags().GetString("secretAuth")
// secretReturn, _ := cmd.Flags().GetString("secretReturn")
//
// proofInputs, err := parseProofPara(proofsPara)
// if err != nil {
// return
// }
//
// proofInputs.Secrets = &mixTy.DHSecretGroup{
// Receiver: secretReceiver,
// Authorize: secretAuth,
// Returner: secretReturn,
// }
//
// payload := &mixTy.MixDepositAction{}
// payload.Proof = proofInputs
//
// params := &rpctypes.CreateTxIn{
// Execer: getRealExecName(paraName, mixTy.MixX),
// ActionName: "Deposit",
// Payload: types.MustPBToJSON(payload),
// }
// rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr")
// ctx := jsonclient.NewRPCCtx(rpcLaddr, "Chain33.CreateTransaction", params, nil)
// ctx.RunWithoutMarshal()
//
//}
//
//// CreateWithdrawCmd create raw asset transfer tx
//func CreateWithdrawCmd() *cobra.Command {
// cmd := &cobra.Command{
// Use: "withdraw",
// Short: "Create a asset withdraw from mix coin contract",
// Run: createWithdraw,
// }
// addCreateWithdrawFlags(cmd)
// return cmd
//}
//
//func addCreateWithdrawFlags(cmd *cobra.Command) {
// cmd.Flags().StringP("proofs", "p", "", "spend 'proof-pubinput' pair, multi pairs allowed with ','")
// cmd.MarkFlagRequired("proofs")
//
// cmd.Flags().Uint64P("amount", "a", 0, "withdraw amount")
// cmd.MarkFlagRequired("amount")
//
//}
//
//func createWithdraw(cmd *cobra.Command, args []string) {
// paraName, _ := cmd.Flags().GetString("paraName")
// amount, _ := cmd.Flags().GetUint64("amount")
// proofsPara, _ := cmd.Flags().GetString("proofs")
//
// proofInputs, err := parseProofPara(proofsPara)
// if err != nil {
// return
// }
//
// payload := &mixTy.MixWithdrawAction{}
// payload.Amount = amount
// payload.SpendCommits = append(payload.SpendCommits, proofInputs)
// params := &rpctypes.CreateTxIn{
// Execer: getRealExecName(paraName, mixTy.MixX),
// ActionName: "Withdraw",
// Payload: types.MustPBToJSON(payload),
// }
// rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr")
// ctx := jsonclient.NewRPCCtx(rpcLaddr, "Chain33.CreateTransaction", params, nil)
// ctx.RunWithoutMarshal()
//
//}
//
//// CreateTransferCmd create raw asset transfer tx
//func CreateTransferCmd() *cobra.Command {
// cmd := &cobra.Command{
// Use: "transfer",
// Short: "Create a asset transfer in mix coin contract",
// Run: createTransfer,
// }
// addCreateTransferFlags(cmd)
// return cmd
//}
//
//func addCreateTransferFlags(cmd *cobra.Command) {
// cmd.Flags().StringP("input", "i", "", "input 'proof-pubinput' pair, multi pairs allowed with ','")
// cmd.MarkFlagRequired("input")
//
// cmd.Flags().StringP("output", "o", "", "output 'proof-pubinput' pair")
// cmd.MarkFlagRequired("output")
//
// cmd.Flags().StringP("secretReceiver", "p", "", "secret for receiver addr")
// cmd.MarkFlagRequired("secretReceiver")
//
// cmd.Flags().StringP("secretAuth", "a", "", "secret for authorize addr")
//
// cmd.Flags().StringP("secretReturn", "r", "", "secret for return addr")
//
// cmd.Flags().StringP("change", "c", "", "output change 'proof-pubinput' pair")
// cmd.MarkFlagRequired("change")
//
// cmd.Flags().StringP("changeReceiver", "t", "", "secret for change receiver addr")
// cmd.MarkFlagRequired("changeReceiver")
//
// cmd.Flags().StringP("changeAuth", "u", "", "secret for change authorize addr")
//
// cmd.Flags().StringP("changeReturn", "e", "", "secret for change return addr")
//
//}
//
//func createTransfer(cmd *cobra.Command, args []string) {
// paraName, _ := cmd.Flags().GetString("paraName")
// proofsInput, _ := cmd.Flags().GetString("input")
// proofsOutput, _ := cmd.Flags().GetString("output")
// proofsChange, _ := cmd.Flags().GetString("change")
// secretReceiver, _ := cmd.Flags().GetString("secretReceiver")
// secretAuth, _ := cmd.Flags().GetString("secretAuth")
// secretReturn, _ := cmd.Flags().GetString("secretReturn")
// changeReceiver, _ := cmd.Flags().GetString("changeReceiver")
// changeAuth, _ := cmd.Flags().GetString("changeAuth")
// changeReturn, _ := cmd.Flags().GetString("changeReturn")
//
// proofInputs, err := parseProofPara(proofsInput)
// if err != nil {
// fmt.Println("proofsInput error")
// return
// }
// proofOutputs, err := parseProofPara(proofsOutput)
// if err != nil {
// fmt.Println("proofsOutput error")
// return
// }
// proofOutputs.Secrets = &mixTy.DHSecretGroup{
// Receiver: secretReceiver,
// Returner: secretAuth,
// Authorize: secretReturn,
// }
//
// proofChanges, err := parseProofPara(proofsChange)
// if err != nil {
// fmt.Println("proofsOutput error")
// return
// }
// proofChanges.Secrets = &mixTy.DHSecretGroup{
// Receiver: changeReceiver,
// Returner: changeAuth,
// Authorize: changeReturn,
// }
//
// payload := &mixTy.MixTransferAction{}
// payload.Input = proofInputs
// payload.Output = proofOutputs
// payload.Change = proofChanges
// params := &rpctypes.CreateTxIn{
// Execer: getRealExecName(paraName, mixTy.MixX),
// ActionName: "Transfer",
// Payload: types.MustPBToJSON(payload),
// }
// rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr")
// ctx := jsonclient.NewRPCCtx(rpcLaddr, "Chain33.CreateTransaction", params, nil)
// ctx.RunWithoutMarshal()
//
//}
//
//// CreateAuthorizeCmd create raw asset transfer tx
//func CreateAuthorizeCmd() *cobra.Command {
// cmd := &cobra.Command{
// Use: "authorize",
// Short: "Create a asset authorize in mix coin contract",
// Run: createAuthorize,
// }
// addCreateAuthorizeFlags(cmd)
// return cmd
//}
//
//func addCreateAuthorizeFlags(cmd *cobra.Command) {
// cmd.Flags().StringP("proofs", "p", "", "authorize 'proof-pubinput' pair, multi pairs allowed with ','")
// cmd.MarkFlagRequired("proofs")
//
//}
//
//func createAuthorize(cmd *cobra.Command, args []string) {
// paraName, _ := cmd.Flags().GetString("paraName")
// proofsPara, _ := cmd.Flags().GetString("proofs")
//
// proofInput, err := parseProofPara(proofsPara)
// if err != nil {
// return
// }
//
// payload := &mixTy.MixAuthorizeAction{}
// payload.AuthCommits = append(payload.AuthCommits, proofInput)
// params := &rpctypes.CreateTxIn{
// Execer: getRealExecName(paraName, mixTy.MixX),
// ActionName: "Authorize",
// Payload: types.MustPBToJSON(payload),
// }
// rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr")
// ctx := jsonclient.NewRPCCtx(rpcLaddr, "Chain33.CreateTransaction", params, nil)
// ctx.RunWithoutMarshal()
//
//}
// CreateDepositCmd create raw asset transfer tx
func CreateConfigCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "config",
......@@ -628,8 +362,8 @@ func showMixTxs(cmd *cobra.Command, args []string) {
// ShowProposalBoardCmd 显示提案查询信息
func ShowPaymentPubKeyCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "paykey",
Short: "show peer addr payment key info",
Use: "rcvkey",
Short: "show peer addr receive key info",
Run: showPayment,
}
addShowPaymentflags(cmd)
......@@ -721,22 +455,30 @@ func ShowAccountNoteInfo() *cobra.Command {
}
func accountNoteCmdFlags(cmd *cobra.Command) {
cmd.Flags().StringP("accounts", "a", "", "accounts,note status:1:valid,2:frozen,3:used")
cmd.MarkFlagRequired("accounts")
cmd.Flags().StringP("account", "a", "", "account")
cmd.Flags().StringP("hash", "n", "", "notehash")
cmd.Flags().Int32P("status", "s", 0, "note status:1:valid,2:used,3:frozen,4:unfrozen")
}
func accountNote(cmd *cobra.Command, args []string) {
rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr")
accounts, _ := cmd.Flags().GetString("accounts")
account, _ := cmd.Flags().GetString("account")
hash, _ := cmd.Flags().GetString("hash")
status, _ := cmd.Flags().GetInt32("status")
l := strings.Split(accounts, ",")
if len(account) == 0 && len(hash) == 0 && status == 0 {
fmt.Println("neet set parameters, check by --help")
return
}
var params types.ReqAddrs
params.Addrs = append(params.Addrs, l...)
var params mixTy.WalletMixIndexReq
params.Account = account
params.NoteHash = hash
params.Status = status
var res mixTy.WalletIndexResp
ctx := jsonclient.NewRPCCtx(rpcLaddr, "mix.ShowAccountNoteInfo", params, &res)
var res mixTy.WalletNoteResp
ctx := jsonclient.NewRPCCtx(rpcLaddr, "mix.ShowAccountNoteInfo", &params, &res)
ctx.Run()
}
......@@ -1047,7 +789,6 @@ func depositSecretCmdFlags(cmd *cobra.Command) {
cmd.Flags().StringP("exec", "e", "coins", "asset executor(coins, token, paracross), default coins")
cmd.Flags().StringP("path", "p", "", "deposit circuit path ")
cmd.MarkFlagRequired("path")
}
......
# mix 执行器 零知识证明隐私
## 场景
1. 存款,公转私,支持一次存入多个目标账户,目标账户隐藏,转账金额公开(需要验证金额足够)
1. 转账,私对私,花费某个支票,转账给目标账户,多出部分找零给自己,目标账户和金额全隐藏
1. 提款,私对公,花费某些支票,统一转出给签名地址,转账金额公开(验证),签名地址和支票账户不一定对应,也就是任何知道支票密码的人都可以提款
......@@ -397,22 +397,19 @@ message PaymentKeysReq{
enum NoteStatus{
UNDEF = 0;
VALID = 1; //已授权可使用
FROZEN = 2; //未授权
USED = 3; //已使用
VALID = 1; //已授权可使用 相对消费者
USED = 2; //已使用
FROZEN = 3; //未授权
UNFROZEN = 4; //已授权 相对授权者
}
enum Role{
SPENDER = 0;
RETURNER = 1;
AUTHORIZER = 2;
}
message WalletIndexInfo {
message WalletNoteInfo {
string noteHash = 1;
string nullifier = 2;
string authorizeSpendHash = 3;
Role role = 4;
string authorizeHash = 4;
string account = 5; //账户地址
NoteStatus status = 6;
SecretData secret = 7;
......@@ -420,7 +417,7 @@ message WalletIndexInfo {
}
message WalletDbMixInfo {
WalletIndexInfo info = 1;
WalletNoteInfo info = 1;
string txIndex = 2;
}
......@@ -429,19 +426,17 @@ message WalletMixIndexReq {
string noteHash = 1;
string nullifier = 2;
string authorizeSpendHash = 3;
string authorizeHash = 4;
string account = 5;
int32 status = 6;
int32 count = 7;
int32 direction = 8;
}
message WalletIndexResp {
repeated WalletIndexInfo notes = 1;
message WalletNoteResp {
repeated WalletNoteInfo notes = 1;
}
message WalletReqAddrs{
repeated string addrs = 1;
}
message WalletEnablePrivacyRst{
string addr = 1;
......
......@@ -65,13 +65,13 @@ func (c *Jrpc) ShowAccountPrivacyInfo(in *types.ReqString, result *json.RawMessa
/////////////////privacy///////////////
// ShowPrivacyAccountSpend display spend privacy account for json rpc
func (c *Jrpc) ShowAccountNoteInfo(in *types.ReqAddrs, result *json.RawMessage) error {
if 0 == len(in.Addrs) {
func (c *Jrpc) ShowAccountNoteInfo(in *mixTy.WalletMixIndexReq, result *json.RawMessage) error {
if in == nil {
return types.ErrInvalidParam
}
reply, err := c.cli.ExecWalletFunc(mixTy.MixX, "ShowAccountNoteInfo", in)
if err != nil {
log.Info("ShowPrivacyAccountSpend", "return err info", err)
log.Error("ShowAccountNoteInfo", "return err info", err)
return err
}
*result, err = types.PBToJSON(reply)
......@@ -134,43 +134,6 @@ func (c *Jrpc) DecryptSecretData(in *mixTy.DecryptSecretData, result *json.RawMe
return err
}
//
//func (c *Jrpc) DepositProof(in *mixTy.DepositTxReq, result *json.RawMessage) error {
// reply, err := c.cli.ExecWalletFunc(mixTy.MixX, "DepositProof", in)
// if err != nil {
// return err
// }
// *result, err = types.PBToJSON(reply)
// return err
//}
//
//func (c *Jrpc) AuthProof(in *mixTy.AuthTxReq, result *json.RawMessage) error {
// reply, err := c.cli.ExecWalletFunc(mixTy.MixX, "AuthProof", in)
// if err != nil {
// return err
// }
// *result, err = types.PBToJSON(reply)
// return err
//}
//
//func (c *Jrpc) TransferProof(in *mixTy.TransferTxReq, result *json.RawMessage) error {
// reply, err := c.cli.ExecWalletFunc(mixTy.MixX, "TransferProof", in)
// if err != nil {
// return err
// }
// *result, err = types.PBToJSON(reply)
// return err
//}
//
//func (c *Jrpc) WithdrawProof(in *mixTy.WithdrawTxReq, result *json.RawMessage) error {
// reply, err := c.cli.ExecWalletFunc(mixTy.MixX, "WithdrawProof", in)
// if err != nil {
// return err
// }
// *result, err = types.PBToJSON(reply)
// return err
//}
func (c *Jrpc) CreateRawTransaction(in *mixTy.CreateRawTxReq, result *interface{}) error {
reply, err := c.cli.ExecWalletFunc(mixTy.MixX, "CreateRawTransaction", in)
if err != nil {
......
......@@ -120,24 +120,27 @@ func (MixConfigAct) EnumDescriptor() ([]byte, []int) {
type NoteStatus int32
const (
NoteStatus_UNDEF NoteStatus = 0
NoteStatus_VALID NoteStatus = 1
NoteStatus_FROZEN NoteStatus = 2
NoteStatus_USED NoteStatus = 3
NoteStatus_UNDEF NoteStatus = 0
NoteStatus_VALID NoteStatus = 1
NoteStatus_USED NoteStatus = 2
NoteStatus_FROZEN NoteStatus = 3
NoteStatus_UNFROZEN NoteStatus = 4
)
var NoteStatus_name = map[int32]string{
0: "UNDEF",
1: "VALID",
2: "FROZEN",
3: "USED",
2: "USED",
3: "FROZEN",
4: "UNFROZEN",
}
var NoteStatus_value = map[string]int32{
"UNDEF": 0,
"VALID": 1,
"FROZEN": 2,
"USED": 3,
"UNDEF": 0,
"VALID": 1,
"USED": 2,
"FROZEN": 3,
"UNFROZEN": 4,
}
func (x NoteStatus) String() string {
......@@ -148,34 +151,6 @@ func (NoteStatus) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{3}
}
type Role int32
const (
Role_SPENDER Role = 0
Role_RETURNER Role = 1
Role_AUTHORIZER Role = 2
)
var Role_name = map[int32]string{
0: "SPENDER",
1: "RETURNER",
2: "AUTHORIZER",
}
var Role_value = map[string]int32{
"SPENDER": 0,
"RETURNER": 1,
"AUTHORIZER": 2,
}
func (x Role) String() string {
return proto.EnumName(Role_name, int32(x))
}
func (Role) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{4}
}
type MixWalletRescanStatus int32
const (
......@@ -201,7 +176,7 @@ func (x MixWalletRescanStatus) String() string {
}
func (MixWalletRescanStatus) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{5}
return fileDescriptor_5c21d519a9be369a, []int{4}
}
type ZkVerifyKey struct {
......@@ -3121,11 +3096,11 @@ func (m *PaymentKeysReq) GetDetail() int32 {
return 0
}
type WalletIndexInfo struct {
type WalletNoteInfo struct {
NoteHash string `protobuf:"bytes,1,opt,name=noteHash,proto3" json:"noteHash,omitempty"`
Nullifier string `protobuf:"bytes,2,opt,name=nullifier,proto3" json:"nullifier,omitempty"`
AuthorizeSpendHash string `protobuf:"bytes,3,opt,name=authorizeSpendHash,proto3" json:"authorizeSpendHash,omitempty"`
Role Role `protobuf:"varint,4,opt,name=role,proto3,enum=types.Role" json:"role,omitempty"`
AuthorizeHash string `protobuf:"bytes,4,opt,name=authorizeHash,proto3" json:"authorizeHash,omitempty"`
Account string `protobuf:"bytes,5,opt,name=account,proto3" json:"account,omitempty"`
Status NoteStatus `protobuf:"varint,6,opt,name=status,proto3,enum=types.NoteStatus" json:"status,omitempty"`
Secret *SecretData `protobuf:"bytes,7,opt,name=secret,proto3" json:"secret,omitempty"`
......@@ -3134,74 +3109,74 @@ type WalletIndexInfo struct {
XXX_sizecache int32 `json:"-"`
}
func (m *WalletIndexInfo) Reset() { *m = WalletIndexInfo{} }
func (m *WalletIndexInfo) String() string { return proto.CompactTextString(m) }
func (*WalletIndexInfo) ProtoMessage() {}
func (*WalletIndexInfo) Descriptor() ([]byte, []int) {
func (m *WalletNoteInfo) Reset() { *m = WalletNoteInfo{} }
func (m *WalletNoteInfo) String() string { return proto.CompactTextString(m) }
func (*WalletNoteInfo) ProtoMessage() {}
func (*WalletNoteInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{50}
}
func (m *WalletIndexInfo) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_WalletIndexInfo.Unmarshal(m, b)
func (m *WalletNoteInfo) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_WalletNoteInfo.Unmarshal(m, b)
}
func (m *WalletIndexInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_WalletIndexInfo.Marshal(b, m, deterministic)
func (m *WalletNoteInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_WalletNoteInfo.Marshal(b, m, deterministic)
}
func (m *WalletIndexInfo) XXX_Merge(src proto.Message) {
xxx_messageInfo_WalletIndexInfo.Merge(m, src)
func (m *WalletNoteInfo) XXX_Merge(src proto.Message) {
xxx_messageInfo_WalletNoteInfo.Merge(m, src)
}
func (m *WalletIndexInfo) XXX_Size() int {
return xxx_messageInfo_WalletIndexInfo.Size(m)
func (m *WalletNoteInfo) XXX_Size() int {
return xxx_messageInfo_WalletNoteInfo.Size(m)
}
func (m *WalletIndexInfo) XXX_DiscardUnknown() {
xxx_messageInfo_WalletIndexInfo.DiscardUnknown(m)
func (m *WalletNoteInfo) XXX_DiscardUnknown() {
xxx_messageInfo_WalletNoteInfo.DiscardUnknown(m)
}
var xxx_messageInfo_WalletIndexInfo proto.InternalMessageInfo
var xxx_messageInfo_WalletNoteInfo proto.InternalMessageInfo
func (m *WalletIndexInfo) GetNoteHash() string {
func (m *WalletNoteInfo) GetNoteHash() string {
if m != nil {
return m.NoteHash
}
return ""
}
func (m *WalletIndexInfo) GetNullifier() string {
func (m *WalletNoteInfo) GetNullifier() string {
if m != nil {
return m.Nullifier
}
return ""
}
func (m *WalletIndexInfo) GetAuthorizeSpendHash() string {
func (m *WalletNoteInfo) GetAuthorizeSpendHash() string {
if m != nil {
return m.AuthorizeSpendHash
}
return ""
}
func (m *WalletIndexInfo) GetRole() Role {
func (m *WalletNoteInfo) GetAuthorizeHash() string {
if m != nil {
return m.Role
return m.AuthorizeHash
}
return Role_SPENDER
return ""
}
func (m *WalletIndexInfo) GetAccount() string {
func (m *WalletNoteInfo) GetAccount() string {
if m != nil {
return m.Account
}
return ""
}
func (m *WalletIndexInfo) GetStatus() NoteStatus {
func (m *WalletNoteInfo) GetStatus() NoteStatus {
if m != nil {
return m.Status
}
return NoteStatus_UNDEF
}
func (m *WalletIndexInfo) GetSecret() *SecretData {
func (m *WalletNoteInfo) GetSecret() *SecretData {
if m != nil {
return m.Secret
}
......@@ -3209,11 +3184,11 @@ func (m *WalletIndexInfo) GetSecret() *SecretData {
}
type WalletDbMixInfo struct {
Info *WalletIndexInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"`
TxIndex string `protobuf:"bytes,2,opt,name=txIndex,proto3" json:"txIndex,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Info *WalletNoteInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"`
TxIndex string `protobuf:"bytes,2,opt,name=txIndex,proto3" json:"txIndex,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *WalletDbMixInfo) Reset() { *m = WalletDbMixInfo{} }
......@@ -3241,7 +3216,7 @@ func (m *WalletDbMixInfo) XXX_DiscardUnknown() {
var xxx_messageInfo_WalletDbMixInfo proto.InternalMessageInfo
func (m *WalletDbMixInfo) GetInfo() *WalletIndexInfo {
func (m *WalletDbMixInfo) GetInfo() *WalletNoteInfo {
if m != nil {
return m.Info
}
......@@ -3259,6 +3234,7 @@ type WalletMixIndexReq struct {
NoteHash string `protobuf:"bytes,1,opt,name=noteHash,proto3" json:"noteHash,omitempty"`
Nullifier string `protobuf:"bytes,2,opt,name=nullifier,proto3" json:"nullifier,omitempty"`
AuthorizeSpendHash string `protobuf:"bytes,3,opt,name=authorizeSpendHash,proto3" json:"authorizeSpendHash,omitempty"`
AuthorizeHash string `protobuf:"bytes,4,opt,name=authorizeHash,proto3" json:"authorizeHash,omitempty"`
Account string `protobuf:"bytes,5,opt,name=account,proto3" json:"account,omitempty"`
Status int32 `protobuf:"varint,6,opt,name=status,proto3" json:"status,omitempty"`
Count int32 `protobuf:"varint,7,opt,name=count,proto3" json:"count,omitempty"`
......@@ -3314,6 +3290,13 @@ func (m *WalletMixIndexReq) GetAuthorizeSpendHash() string {
return ""
}
func (m *WalletMixIndexReq) GetAuthorizeHash() string {
if m != nil {
return m.AuthorizeHash
}
return ""
}
func (m *WalletMixIndexReq) GetAccount() string {
if m != nil {
return m.Account
......@@ -3342,84 +3325,45 @@ func (m *WalletMixIndexReq) GetDirection() int32 {
return 0
}
type WalletIndexResp struct {
Notes []*WalletIndexInfo `protobuf:"bytes,1,rep,name=notes,proto3" json:"notes,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
type WalletNoteResp struct {
Notes []*WalletNoteInfo `protobuf:"bytes,1,rep,name=notes,proto3" json:"notes,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *WalletIndexResp) Reset() { *m = WalletIndexResp{} }
func (m *WalletIndexResp) String() string { return proto.CompactTextString(m) }
func (*WalletIndexResp) ProtoMessage() {}
func (*WalletIndexResp) Descriptor() ([]byte, []int) {
func (m *WalletNoteResp) Reset() { *m = WalletNoteResp{} }
func (m *WalletNoteResp) String() string { return proto.CompactTextString(m) }
func (*WalletNoteResp) ProtoMessage() {}
func (*WalletNoteResp) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{53}
}
func (m *WalletIndexResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_WalletIndexResp.Unmarshal(m, b)
func (m *WalletNoteResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_WalletNoteResp.Unmarshal(m, b)
}
func (m *WalletIndexResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_WalletIndexResp.Marshal(b, m, deterministic)
func (m *WalletNoteResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_WalletNoteResp.Marshal(b, m, deterministic)
}
func (m *WalletIndexResp) XXX_Merge(src proto.Message) {
xxx_messageInfo_WalletIndexResp.Merge(m, src)
func (m *WalletNoteResp) XXX_Merge(src proto.Message) {
xxx_messageInfo_WalletNoteResp.Merge(m, src)
}
func (m *WalletIndexResp) XXX_Size() int {
return xxx_messageInfo_WalletIndexResp.Size(m)
func (m *WalletNoteResp) XXX_Size() int {
return xxx_messageInfo_WalletNoteResp.Size(m)
}
func (m *WalletIndexResp) XXX_DiscardUnknown() {
xxx_messageInfo_WalletIndexResp.DiscardUnknown(m)
func (m *WalletNoteResp) XXX_DiscardUnknown() {
xxx_messageInfo_WalletNoteResp.DiscardUnknown(m)
}
var xxx_messageInfo_WalletIndexResp proto.InternalMessageInfo
var xxx_messageInfo_WalletNoteResp proto.InternalMessageInfo
func (m *WalletIndexResp) GetNotes() []*WalletIndexInfo {
func (m *WalletNoteResp) GetNotes() []*WalletNoteInfo {
if m != nil {
return m.Notes
}
return nil
}
type WalletReqAddrs struct {
Addrs []string `protobuf:"bytes,1,rep,name=addrs,proto3" json:"addrs,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *WalletReqAddrs) Reset() { *m = WalletReqAddrs{} }
func (m *WalletReqAddrs) String() string { return proto.CompactTextString(m) }
func (*WalletReqAddrs) ProtoMessage() {}
func (*WalletReqAddrs) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{54}
}
func (m *WalletReqAddrs) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_WalletReqAddrs.Unmarshal(m, b)
}
func (m *WalletReqAddrs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_WalletReqAddrs.Marshal(b, m, deterministic)
}
func (m *WalletReqAddrs) XXX_Merge(src proto.Message) {
xxx_messageInfo_WalletReqAddrs.Merge(m, src)
}
func (m *WalletReqAddrs) XXX_Size() int {
return xxx_messageInfo_WalletReqAddrs.Size(m)
}
func (m *WalletReqAddrs) XXX_DiscardUnknown() {
xxx_messageInfo_WalletReqAddrs.DiscardUnknown(m)
}
var xxx_messageInfo_WalletReqAddrs proto.InternalMessageInfo
func (m *WalletReqAddrs) GetAddrs() []string {
if m != nil {
return m.Addrs
}
return nil
}
type WalletEnablePrivacyRst struct {
Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"`
IsOK bool `protobuf:"varint,2,opt,name=isOK,proto3" json:"isOK,omitempty"`
......@@ -3433,7 +3377,7 @@ func (m *WalletEnablePrivacyRst) Reset() { *m = WalletEnablePrivacyRst{}
func (m *WalletEnablePrivacyRst) String() string { return proto.CompactTextString(m) }
func (*WalletEnablePrivacyRst) ProtoMessage() {}
func (*WalletEnablePrivacyRst) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{55}
return fileDescriptor_5c21d519a9be369a, []int{54}
}
func (m *WalletEnablePrivacyRst) XXX_Unmarshal(b []byte) error {
......@@ -3486,7 +3430,7 @@ func (m *WalletEnablePrivacyResp) Reset() { *m = WalletEnablePrivacyResp
func (m *WalletEnablePrivacyResp) String() string { return proto.CompactTextString(m) }
func (*WalletEnablePrivacyResp) ProtoMessage() {}
func (*WalletEnablePrivacyResp) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{56}
return fileDescriptor_5c21d519a9be369a, []int{55}
}
func (m *WalletEnablePrivacyResp) XXX_Unmarshal(b []byte) error {
......@@ -3527,7 +3471,7 @@ func (m *LocalMixTx) Reset() { *m = LocalMixTx{} }
func (m *LocalMixTx) String() string { return proto.CompactTextString(m) }
func (*LocalMixTx) ProtoMessage() {}
func (*LocalMixTx) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{57}
return fileDescriptor_5c21d519a9be369a, []int{56}
}
func (m *LocalMixTx) XXX_Unmarshal(b []byte) error {
......@@ -3585,7 +3529,7 @@ func (m *MixTxListReq) Reset() { *m = MixTxListReq{} }
func (m *MixTxListReq) String() string { return proto.CompactTextString(m) }
func (*MixTxListReq) ProtoMessage() {}
func (*MixTxListReq) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{58}
return fileDescriptor_5c21d519a9be369a, []int{57}
}
func (m *MixTxListReq) XXX_Unmarshal(b []byte) error {
......@@ -3659,7 +3603,7 @@ func (m *MixTxListResp) Reset() { *m = MixTxListResp{} }
func (m *MixTxListResp) String() string { return proto.CompactTextString(m) }
func (*MixTxListResp) ProtoMessage() {}
func (*MixTxListResp) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{59}
return fileDescriptor_5c21d519a9be369a, []int{58}
}
func (m *MixTxListResp) XXX_Unmarshal(b []byte) error {
......@@ -3700,7 +3644,7 @@ func (m *PrivacyAddrResult) Reset() { *m = PrivacyAddrResult{} }
func (m *PrivacyAddrResult) String() string { return proto.CompactTextString(m) }
func (*PrivacyAddrResult) ProtoMessage() {}
func (*PrivacyAddrResult) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{60}
return fileDescriptor_5c21d519a9be369a, []int{59}
}
func (m *PrivacyAddrResult) XXX_Unmarshal(b []byte) error {
......@@ -3753,7 +3697,7 @@ func (m *ReqEnablePrivacyRst) Reset() { *m = ReqEnablePrivacyRst{} }
func (m *ReqEnablePrivacyRst) String() string { return proto.CompactTextString(m) }
func (*ReqEnablePrivacyRst) ProtoMessage() {}
func (*ReqEnablePrivacyRst) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{61}
return fileDescriptor_5c21d519a9be369a, []int{60}
}
func (m *ReqEnablePrivacyRst) XXX_Unmarshal(b []byte) error {
......@@ -3786,7 +3730,6 @@ func init() {
proto.RegisterEnum("types.MixConfigType", MixConfigType_name, MixConfigType_value)
proto.RegisterEnum("types.MixConfigAct", MixConfigAct_name, MixConfigAct_value)
proto.RegisterEnum("types.NoteStatus", NoteStatus_name, NoteStatus_value)
proto.RegisterEnum("types.Role", Role_name, Role_value)
proto.RegisterEnum("types.MixWalletRescanStatus", MixWalletRescanStatus_name, MixWalletRescanStatus_value)
proto.RegisterType((*ZkVerifyKey)(nil), "types.ZkVerifyKey")
proto.RegisterType((*ZkVerifyKeys)(nil), "types.ZkVerifyKeys")
......@@ -3838,11 +3781,10 @@ func init() {
proto.RegisterType((*ShieldAmountRst)(nil), "types.ShieldAmountRst")
proto.RegisterType((*CreateRawTxReq)(nil), "types.CreateRawTxReq")
proto.RegisterType((*PaymentKeysReq)(nil), "types.PaymentKeysReq")
proto.RegisterType((*WalletIndexInfo)(nil), "types.WalletIndexInfo")
proto.RegisterType((*WalletNoteInfo)(nil), "types.WalletNoteInfo")
proto.RegisterType((*WalletDbMixInfo)(nil), "types.WalletDbMixInfo")
proto.RegisterType((*WalletMixIndexReq)(nil), "types.WalletMixIndexReq")
proto.RegisterType((*WalletIndexResp)(nil), "types.WalletIndexResp")
proto.RegisterType((*WalletReqAddrs)(nil), "types.WalletReqAddrs")
proto.RegisterType((*WalletNoteResp)(nil), "types.WalletNoteResp")
proto.RegisterType((*WalletEnablePrivacyRst)(nil), "types.WalletEnablePrivacyRst")
proto.RegisterType((*WalletEnablePrivacyResp)(nil), "types.WalletEnablePrivacyResp")
proto.RegisterType((*LocalMixTx)(nil), "types.LocalMixTx")
......@@ -3857,172 +3799,168 @@ func init() {
}
var fileDescriptor_5c21d519a9be369a = []byte{
// 2625 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5a, 0xcd, 0x73, 0x23, 0x47,
0x15, 0xf7, 0xe8, 0xd3, 0x7a, 0x96, 0x6c, 0xb9, 0x77, 0xe3, 0x28, 0xae, 0x10, 0x4c, 0x27, 0x24,
0xc6, 0x9b, 0x5a, 0x82, 0x36, 0x04, 0xa8, 0x82, 0x0d, 0xca, 0x4a, 0x1b, 0x2b, 0x59, 0x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fc, 0xf3, 0x61, 0xe3, 0x41, 0xbb, 0x59, 0x75, 0x50, 0xfe, 0x3e, 0xdb, 0x7d, 0xd2, 0xea, 0x54,
0x33, 0xb8, 0xd7, 0x7e, 0xb7, 0xd5, 0xac, 0x66, 0xb7, 0xbe, 0x07, 0x39, 0x6c, 0xbe, 0xb8, 0x67,
0x77, 0xaf, 0xd5, 0x69, 0xb6, 0x98, 0xf4, 0x95, 0xb5, 0x7a, 0xfb, 0xac, 0xd3, 0x62, 0x55, 0x87,
0x2c, 0x03, 0xc4, 0x4e, 0xb0, 0x6a, 0x66, 0xeb, 0x27, 0xf0, 0xda, 0x8e, 0x37, 0xd5, 0x45, 0x1b,
0xf6, 0xdd, 0x91, 0xda, 0x77, 0x11, 0x72, 0xed, 0xe6, 0x83, 0x96, 0x54, 0xd0, 0xbd, 0xd7, 0xe8,
0x74, 0xda, 0x9d, 0x4f, 0xab, 0x0e, 0x52, 0xf7, 0xdb, 0x9d, 0x76, 0x77, 0xbb, 0xd5, 0xac, 0x66,
0xea, 0x7f, 0x76, 0x00, 0x4e, 0xbc, 0xa9, 0x7e, 0x0b, 0xfc, 0x10, 0x56, 0x3e, 0x4d, 0xe9, 0xa9,
0xe8, 0x53, 0x81, 0x3f, 0xef, 0x78, 0xc3, 0xf5, 0x6a, 0x42, 0x76, 0xa3, 0xc0, 0x1b, 0x1d, 0xd1,
0x05, 0xf2, 0x01, 0x2c, 0xc9, 0x25, 0xe8, 0xf6, 0x95, 0x56, 0xdc, 0x85, 0x8a, 0x95, 0x22, 0x64,
0x25, 0x11, 0x12, 0x7d, 0x67, 0x7d, 0x3d, 0x61, 0xa4, 0x93, 0x89, 0x2e, 0x3c, 0x2d, 0x88, 0x7f,
0x67, 0xb8, 0xf3, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x73, 0x91, 0xca, 0x02, 0x03, 0x21, 0x00,
0x00,
// 2567 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00,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 0x48, 0x1b, 0x20, 0x29, 0x43, 0x61, 0xaf, 0xd3, 0x6c, 0x6d, 0xd4, 0x66, 0xf0,
0xcf, 0x27, 0x8d, 0xc7, 0xed, 0x66, 0xcd, 0x41, 0xfd, 0x7b, 0xbb, 0xad, 0x66, 0xcd, 0xc5, 0x95,
0x1b, 0x6c, 0xfb, 0x45, 0xab, 0x53, 0xcb, 0xa1, 0x5b, 0x7b, 0x1d, 0x45, 0xe5, 0xd7, 0x3e, 0x85,
0x77, 0xb6, 0xfc, 0x89, 0x4c, 0x72, 0xc6, 0xa3, 0x9e, 0x37, 0x54, 0x2a, 0x67, 0x21, 0xdf, 0x6e,
0x3e, 0x6e, 0x49, 0x1c, 0x76, 0x1f, 0x34, 0x3a, 0x9d, 0x76, 0xe7, 0x61, 0xcd, 0x41, 0x6a, 0xa3,
0xdd, 0x69, 0xef, 0x6e, 0xa2, 0xe2, 0xf5, 0x3f, 0x3b, 0x00, 0x47, 0xfe, 0x44, 0xbf, 0xf2, 0x7d,
0x0c, 0x0b, 0x0f, 0x33, 0x7a, 0xaa, 0x2a, 0x06, 0x8c, 0xbf, 0xee, 0xf8, 0x83, 0xe5, 0x5a, 0x4a,
0xee, 0xc6, 0xa1, 0x3f, 0x3c, 0xa0, 0x33, 0xe4, 0x23, 0x98, 0x93, 0x4b, 0xd0, 0xa3, 0x4b, 0xad,
0xb8, 0x0f, 0x55, 0x2b, 0xfa, 0x64, 0x21, 0x15, 0x12, 0x0f, 0x54, 0xcb, 0xcb, 0x29, 0x23, 0x9b,
0x27, 0x74, 0xe6, 0x65, 0x51, 0xfc, 0xa3, 0xc2, 0xbd, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x40,
0x0f, 0x00, 0xa1, 0xdd, 0x20, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
......
......@@ -11,7 +11,7 @@ import (
"github.com/pkg/errors"
)
func (policy *mixPolicy) On_ShowAccountPrivacyInfo(req *mixTy.PaymentKeysReq) (types.Message, error) {
func (p *mixPolicy) On_ShowAccountPrivacyInfo(req *mixTy.PaymentKeysReq) (types.Message, error) {
if len(req.Addr) == 0 && len(req.PrivKey) == 0 {
return nil, errors.Wrapf(types.ErrInvalidParam, "addr or privkey need be set")
}
......@@ -32,7 +32,7 @@ func (policy *mixPolicy) On_ShowAccountPrivacyInfo(req *mixTy.PaymentKeysReq) (t
}
//通过account 从钱包获取
keys, err := policy.getAccountPrivacyKey(req.Addr)
keys, err := p.getAccountPrivacyKey(req.Addr)
if err != nil {
return nil, errors.Wrapf(err, "get account =%s privacy key", req.Addr)
}
......@@ -43,56 +43,40 @@ func (policy *mixPolicy) On_ShowAccountPrivacyInfo(req *mixTy.PaymentKeysReq) (t
return keys, nil
}
func (policy *mixPolicy) On_ShowAccountNoteInfo(req *types.ReqAddrs) (types.Message, error) {
return policy.showAccountNoteInfo(req.Addrs)
func (p *mixPolicy) On_ShowAccountNoteInfo(req *mixTy.WalletMixIndexReq) (types.Message, error) {
return p.showAccountNoteInfo(req)
}
func (policy *mixPolicy) On_GetRescanStatus(in *types.ReqNil) (types.Message, error) {
return &types.ReqString{Data: policy.getRescanStatus()}, nil
func (p *mixPolicy) On_GetRescanStatus(in *types.ReqNil) (types.Message, error) {
return &types.ReqString{Data: p.getRescanStatus()}, nil
}
//重新扫描所有notes
func (policy *mixPolicy) On_RescanNotes(in *types.ReqNil) (types.Message, error) {
err := policy.tryRescanNotes()
func (p *mixPolicy) On_RescanNotes(in *types.ReqNil) (types.Message, error) {
err := p.tryRescanNotes()
if err != nil {
bizlog.Error("rescanUTXOs", "err", err.Error())
}
return &types.ReqString{Data: "ok"}, err
}
func (policy *mixPolicy) On_EnablePrivacy(req *types.ReqAddrs) (types.Message, error) {
return policy.enablePrivacy(req.Addrs)
func (p *mixPolicy) On_EnablePrivacy(req *types.ReqAddrs) (types.Message, error) {
return p.enablePrivacy(req.Addrs)
}
//func (policy *mixPolicy) On_EncodeSecretData(req *mixTy.SecretData) (types.Message, error) {
//func (p *mixPolicy) On_EncodeSecretData(req *mixTy.SecretData) (types.Message, error) {
// return encodeSecretData(req)
//}
func (policy *mixPolicy) On_EncryptSecretData(req *mixTy.EncryptSecretData) (types.Message, error) {
func (p *mixPolicy) On_EncryptSecretData(req *mixTy.EncryptSecretData) (types.Message, error) {
return encryptSecretData(req)
}
func (policy *mixPolicy) On_DecryptSecretData(req *mixTy.DecryptSecretData) (types.Message, error) {
func (p *mixPolicy) On_DecryptSecretData(req *mixTy.DecryptSecretData) (types.Message, error) {
return decryptSecretData(req)
}
//func (policy *mixPolicy) On_DepositProof(req *mixTy.CreateRawTxReq) (types.Message, error) {
// return policy.createDepositTx(req)
//}
//
//func (policy *mixPolicy) On_WithdrawProof(req *mixTy.CreateRawTxReq) (types.Message, error) {
// return policy.createWithdrawTx(req)
//}
//
//func (policy *mixPolicy) On_AuthProof(req *mixTy.CreateRawTxReq) (types.Message, error) {
// return policy.createAuthTx(req)
//}
//
//func (policy *mixPolicy) On_TransferProof(req *mixTy.CreateRawTxReq) (types.Message, error) {
// return policy.createTransferTx(req)
//}
func (policy *mixPolicy) On_CreateRawTransaction(req *mixTy.CreateRawTxReq) (types.Message, error) {
return policy.createRawTx(req)
func (p *mixPolicy) On_CreateRawTransaction(req *mixTy.CreateRawTxReq) (types.Message, error) {
return p.createRawTx(req)
}
......@@ -147,9 +147,9 @@ func mimcHashCalc(sum []byte) []byte {
return mimcbn256.Sum("seed", sum)
}
func (policy *mixPolicy) getPrivKeyByAddr(addr string) (crypto.PrivKey, error) {
func (p *mixPolicy) getPrivKeyByAddr(addr string) (crypto.PrivKey, error) {
//获取指定地址在钱包里的账户信息
Accountstor, err := policy.store.GetAccountByAddr(addr)
Accountstor, err := p.store.GetAccountByAddr(addr)
if err != nil {
bizlog.Error("ProcSendToAddress", "GetAccountByAddr err:", err)
return nil, err
......@@ -161,7 +161,7 @@ func (policy *mixPolicy) getPrivKeyByAddr(addr string) (crypto.PrivKey, error) {
bizlog.Error("ProcSendToAddress", "FromHex err", err)
return nil, err
}
operater := policy.getWalletOperate()
operater := p.getWalletOperate()
password := []byte(operater.GetPassword())
privkey := wcom.CBCDecrypterPrivkey(password, prikeybyte)
//通过privkey生成一个pubkey然后换算成对应的addr
......@@ -178,30 +178,30 @@ func (policy *mixPolicy) getPrivKeyByAddr(addr string) (crypto.PrivKey, error) {
return priv, nil
}
func (policy *mixPolicy) getAccountPrivacyKey(addr string) (*mixTy.WalletAddrPrivacy, error) {
if data, _ := policy.store.getAccountPrivacy(addr); data != nil {
func (p *mixPolicy) getAccountPrivacyKey(addr string) (*mixTy.WalletAddrPrivacy, error) {
if data, _ := p.store.getAccountPrivacy(addr); data != nil {
privacyInfo := &mixTy.AccountPrivacyKey{}
password := []byte(policy.getWalletOperate().GetPassword())
password := []byte(p.getWalletOperate().GetPassword())
decrypted, err := decryptDataWithPading(password, data)
if err != nil {
return policy.savePrivacyPair(addr)
return p.savePrivacyPair(addr)
}
//有可能修改了秘钥,如果解密失败,需要重新设置
err = types.Decode(decrypted, privacyInfo)
if err != nil {
return policy.savePrivacyPair(addr)
return p.savePrivacyPair(addr)
}
return &mixTy.WalletAddrPrivacy{Privacy: privacyInfo, Addr: addr}, nil
}
return policy.savePrivacyPair(addr)
return p.savePrivacyPair(addr)
}
func (policy *mixPolicy) savePrivacyPair(addr string) (*mixTy.WalletAddrPrivacy, error) {
priv, err := policy.getPrivKeyByAddr(addr)
func (p *mixPolicy) savePrivacyPair(addr string) (*mixTy.WalletAddrPrivacy, error) {
priv, err := p.getPrivKeyByAddr(addr)
if err != nil {
return nil, errors.Wrapf(err, "savePrivacyPair addr=%s", addr)
}
......@@ -209,17 +209,17 @@ func (policy *mixPolicy) savePrivacyPair(addr string) (*mixTy.WalletAddrPrivacy,
bizlog.Info("savePrivacyPair", "pri", common.ToHex(priv.Bytes()), "addr", addr)
newPrivacy := newPrivacyKey(priv.Bytes())
password := []byte(policy.getWalletOperate().GetPassword())
password := []byte(p.getWalletOperate().GetPassword())
encryptered := encryptDataWithPadding(password, types.Encode(newPrivacy))
//save the privacy created to wallet db
policy.store.setAccountPrivacy(addr, encryptered)
p.store.setAccountPrivacy(addr, encryptered)
return &mixTy.WalletAddrPrivacy{Privacy: newPrivacy, Addr: addr}, nil
}
//查询钱包里面所有的地址对应的PrivacyKeys
func (policy *mixPolicy) getWalletPrivacyKeys() ([]*mixTy.WalletAddrPrivacy, error) {
func (p *mixPolicy) getWalletPrivacyKeys() ([]*mixTy.WalletAddrPrivacy, error) {
//通过Account前缀查找获取钱包中的所有账户信息
WalletAccStores, err := policy.store.GetAccountByPrefix("Account")
WalletAccStores, err := p.store.GetAccountByPrefix("Account")
if err != nil || len(WalletAccStores) == 0 {
bizlog.Info("getPrivacyKeyPairs", "store getAccountByPrefix error", err)
return nil, err
......@@ -228,7 +228,7 @@ func (policy *mixPolicy) getWalletPrivacyKeys() ([]*mixTy.WalletAddrPrivacy, err
var infoPriRes []*mixTy.WalletAddrPrivacy
for _, AccStore := range WalletAccStores {
if len(AccStore.Addr) != 0 {
if privacyInfo, err := policy.getAccountPrivacyKey(AccStore.Addr); err == nil {
if privacyInfo, err := p.getAccountPrivacyKey(AccStore.Addr); err == nil {
infoPriRes = append(infoPriRes, privacyInfo)
}
}
......@@ -243,38 +243,38 @@ func (policy *mixPolicy) getWalletPrivacyKeys() ([]*mixTy.WalletAddrPrivacy, err
}
func (policy *mixPolicy) getRescanStatus() string {
status := policy.store.getRescanNoteStatus()
func (p *mixPolicy) getRescanStatus() string {
status := p.store.getRescanNoteStatus()
return mixTy.MixWalletRescanStatus(status).String()
}
func (policy *mixPolicy) tryRescanNotes() error {
func (p *mixPolicy) tryRescanNotes() error {
//未使能,直接使能
if !policy.store.getPrivacyEnable() {
//policy.store.enablePrivacy()
if !p.store.getPrivacyEnable() {
//p.store.enablePrivacy()
return errors.Wrap(types.ErrNotAllow, "privacy need enable firstly")
}
operater := policy.getWalletOperate()
operater := p.getWalletOperate()
if operater.IsWalletLocked() {
return types.ErrWalletIsLocked
}
status := policy.store.getRescanNoteStatus()
status := p.store.getRescanNoteStatus()
if status == int32(mixTy.MixWalletRescanStatus_SCANNING) {
return errors.Wrap(types.ErrNotAllow, "mix wallet is scanning")
}
policy.store.setRescanNoteStatus(int32(mixTy.MixWalletRescanStatus_SCANNING))
p.store.setRescanNoteStatus(int32(mixTy.MixWalletRescanStatus_SCANNING))
go policy.rescanNotes()
go p.rescanNotes()
return nil
}
//从localdb中把Mix合约的交易按升序都获取出来依次处理
func (policy *mixPolicy) rescanNotes() {
func (p *mixPolicy) rescanNotes() {
var txInfo mixTy.LocalMixTx
i := 0
operater := policy.getWalletOperate()
operater := p.getWalletOperate()
for {
select {
case <-operater.GetWalletDone():
......@@ -324,19 +324,19 @@ func (policy *mixPolicy) rescanNotes() {
txInfo.Index = mixTxInfos.Txs[txcount-1].GetIndex()
}
policy.processPrivcyTxs(&ReqHashes)
p.processPrivcyTxs(&ReqHashes)
if txcount < int(MaxTxHashsPerTime) {
break
}
}
policy.store.setRescanNoteStatus(int32(mixTy.MixWalletRescanStatus_FINISHED))
p.store.setRescanNoteStatus(int32(mixTy.MixWalletRescanStatus_FINISHED))
return
}
func (policy *mixPolicy) processPrivcyTxs(ReqHashes *types.ReqHashes) {
func (p *mixPolicy) processPrivcyTxs(ReqHashes *types.ReqHashes) {
//通过txhashs获取对应的txdetail
txDetails, err := policy.getWalletOperate().GetAPI().GetTransactionByHash(ReqHashes)
txDetails, err := p.getWalletOperate().GetAPI().GetTransactionByHash(ReqHashes)
if err != nil {
bizlog.Error("processPrivcyTx", "GetTransactionByHash error", err)
return
......@@ -347,18 +347,18 @@ func (policy *mixPolicy) processPrivcyTxs(ReqHashes *types.ReqHashes) {
bizlog.Error("processPrivcyTx wrong tx", "receipt ty", tx.Receipt.Ty, "hash", common.ToHex(tx.Tx.Hash()))
continue
}
set, err := policy.processMixTx(tx.Tx, tx.Height, tx.Index)
set, err := p.processMixTx(tx.Tx, tx.Height, tx.Index)
if err != nil {
bizlog.Error("processPrivcyTx", "processMixTx error", err)
continue
}
policy.store.setKvs(set)
p.store.setKvs(set)
}
}
func (policy *mixPolicy) enablePrivacy(addrs []string) (*mixTy.ReqEnablePrivacyRst, error) {
func (p *mixPolicy) enablePrivacy(addrs []string) (*mixTy.ReqEnablePrivacyRst, error) {
if 0 == len(addrs) {
WalletAccStores, err := policy.store.GetAccountByPrefix("Account")
WalletAccStores, err := p.store.GetAccountByPrefix("Account")
if err != nil || len(WalletAccStores) == 0 {
bizlog.Info("enablePrivacy", "GetAccountByPrefix:err", err)
return nil, types.ErrNotFound
......@@ -376,7 +376,7 @@ func (policy *mixPolicy) enablePrivacy(addrs []string) (*mixTy.ReqEnablePrivacyR
for _, addr := range addrs {
str := ""
isOK := true
_, err := policy.getAccountPrivacyKey(addr)
_, err := p.getAccountPrivacyKey(addr)
if err != nil {
isOK = false
str = err.Error()
......@@ -390,34 +390,25 @@ func (policy *mixPolicy) enablePrivacy(addrs []string) (*mixTy.ReqEnablePrivacyR
rep.Results = append(rep.Results, priAddrResult)
}
policy.store.enablePrivacy()
p.store.enablePrivacy()
return &rep, nil
}
func (policy *mixPolicy) showAccountNoteInfo(addrs []string) (*mixTy.WalletIndexResp, error) {
var resps mixTy.WalletIndexResp
for _, addr := range addrs {
var req mixTy.WalletMixIndexReq
req.Account = addr
resp, err := policy.listMixInfos(&req)
if err != nil {
return nil, err
}
resps.Notes = append(resps.Notes, resp.(*mixTy.WalletIndexResp).Notes...)
}
return &resps, nil
func (p *mixPolicy) showAccountNoteInfo(req *mixTy.WalletMixIndexReq) (*mixTy.WalletNoteResp, error) {
resp, err := p.listMixInfos(req)
return resp.(*mixTy.WalletNoteResp), err
}
func (policy *mixPolicy) createRawTx(req *mixTy.CreateRawTxReq) (*types.Transaction, error) {
func (p *mixPolicy) createRawTx(req *mixTy.CreateRawTxReq) (*types.Transaction, error) {
switch req.ActionTy {
case mixTy.MixActionDeposit:
return policy.createDepositTx(req)
return p.createDepositTx(req)
case mixTy.MixActionWithdraw:
return policy.createWithdrawTx(req)
return p.createWithdrawTx(req)
case mixTy.MixActionAuth:
return policy.createAuthTx(req)
return p.createAuthTx(req)
case mixTy.MixActionTransfer:
return policy.createTransferTx(req)
return p.createTransferTx(req)
default:
return nil, errors.Wrapf(types.ErrInvalidParam, "action=%d", req.ActionTy)
}
......
......@@ -144,6 +144,8 @@ func (p *mixPolicy) processAuth(auth *mixTy.MixAuthorizeAction, table *table.Tab
}
input := out.(*mixTy.AuthorizePublicInput)
updateAuthSpend(table, input.AuthorizeSpendHash)
updateAuthHash(table, input.AuthorizeHash)
}
func (p *mixPolicy) processNullifiers(nulls []string, table *table.Table) {
......@@ -189,11 +191,27 @@ func updateAuthSpend(ldb *table.Table, authSpend string) error {
return ldb.Update([]byte(u.TxIndex), u)
}
func (e *mixPolicy) listMixInfos(req *mixTy.WalletMixIndexReq) (types.Message, error) {
func updateAuthHash(ldb *table.Table, authHash string) error {
xs, err := ldb.ListIndex("authHash", []byte(authHash), nil, 1, 0)
if err != nil || len(xs) != 1 {
bizlog.Error("updateAuthHash update query List failed", "key", authHash, "err", err, "len", len(xs))
return nil
}
u, ok := xs[0].Data.(*mixTy.WalletDbMixInfo)
if !ok {
bizlog.Error("updateAuthSpend update decode failed", "data", xs[0].Data)
return nil
}
u.Info.Status = mixTy.NoteStatus_UNFROZEN
return ldb.Update([]byte(u.TxIndex), u)
}
func (p *mixPolicy) listMixInfos(req *mixTy.WalletMixIndexReq) (types.Message, error) {
if req == nil {
return nil, types.ErrInvalidParam
}
localDb := e.getWalletOperate().GetDBStore()
localDb := p.getWalletOperate().GetDBStore()
query := NewMixTable(localDb).GetQuery(commondb.NewKVDB(localDb))
var primary []byte
......@@ -211,7 +229,7 @@ func (e *mixPolicy) listMixInfos(req *mixTy.WalletMixIndexReq) (types.Message, e
}
cur := &MixRow{
WalletDbMixInfo: &mixTy.WalletDbMixInfo{Info: &mixTy.WalletIndexInfo{
WalletDbMixInfo: &mixTy.WalletDbMixInfo{Info: &mixTy.WalletNoteInfo{
NoteHash: req.NoteHash,
Nullifier: req.Nullifier,
AuthorizeSpendHash: req.AuthorizeSpendHash,
......@@ -233,7 +251,7 @@ func (e *mixPolicy) listMixInfos(req *mixTy.WalletMixIndexReq) (types.Message, e
if len(rows) == 0 {
return nil, types.ErrNotFound
}
var resp mixTy.WalletIndexResp
var resp mixTy.WalletNoteResp
for _, row := range rows {
r, ok := row.Data.(*mixTy.WalletDbMixInfo)
if !ok {
......@@ -245,8 +263,8 @@ func (e *mixPolicy) listMixInfos(req *mixTy.WalletMixIndexReq) (types.Message, e
return &resp, nil
}
func (e *mixPolicy) execAutoDelLocal(tx *types.Transaction) (*types.LocalDBSet, error) {
kvs, err := e.store.DelRollbackKV(tx, tx.Execer)
func (p *mixPolicy) execAutoDelLocal(tx *types.Transaction) (*types.LocalDBSet, error) {
kvs, err := p.store.DelRollbackKV(tx, tx.Execer)
if err != nil {
return nil, err
}
......@@ -255,7 +273,7 @@ func (e *mixPolicy) execAutoDelLocal(tx *types.Transaction) (*types.LocalDBSet,
return dbSet, nil
}
func (p *mixPolicy) addTable(info *mixTy.WalletIndexInfo, heightIndex string, table *table.Table) {
func (p *mixPolicy) addTable(info *mixTy.WalletNoteInfo, heightIndex string, table *table.Table) {
r := &mixTy.WalletDbMixInfo{
Info: info,
TxIndex: heightIndex + info.NoteHash,
......@@ -310,7 +328,7 @@ func (p *mixPolicy) processSecretGroup(noteHash string, secretGroup *mixTy.DHSec
}
}
func (p *mixPolicy) decodeSecret(noteHash string, secretData string, privacyKeys []*mixTy.WalletAddrPrivacy) (*mixTy.WalletIndexInfo, error) {
func (p *mixPolicy) decodeSecret(noteHash string, secretData string, privacyKeys []*mixTy.WalletAddrPrivacy) (*mixTy.WalletNoteInfo, error) {
var dhSecret mixTy.DHSecret
data, err := hex.DecodeString(secretData)
if err != nil {
......@@ -339,13 +357,14 @@ func (p *mixPolicy) decodeSecret(noteHash string, secretData string, privacyKeys
continue
}
bizlog.Info("processSecret.decode rawData OK", "notehash", noteHash, "addr", key.Addr)
//wallet产生deposit tx时候 确保了三个key不同,除非自己构造相同key的交易
if rawData.ReceiverKey == key.Privacy.PaymentKey.ReceiveKey ||
rawData.ReturnKey == key.Privacy.PaymentKey.ReceiveKey ||
rawData.AuthorizeKey == key.Privacy.PaymentKey.ReceiveKey {
//decrypted, save database
var info mixTy.WalletIndexInfo
var info mixTy.WalletNoteInfo
info.NoteHash = noteHash
info.Nullifier = mixTy.Byte2Str(mimcHashString([]string{rawData.NoteRandom}))
info.Nullifier = hex.EncodeToString(mimcHashString([]string{rawData.NoteRandom}))
//如果自己是spender,则记录有关spenderAuthHash,如果是returner,则记录returnerAuthHash
//如果授权为spenderAuthHash,则根据授权hash索引到本地数据库,spender更新本地为VALID,returner侧不变仍为FROZEN,花费后,两端都变为USED
//如果授权为returnerAuthHash,则returner更新本地为VALID,spender侧仍为FROZEN,
......@@ -353,13 +372,10 @@ func (p *mixPolicy) decodeSecret(noteHash string, secretData string, privacyKeys
if len(rawData.AuthorizeKey) > LENNULLKEY {
switch key.Privacy.PaymentKey.ReceiveKey {
case rawData.ReceiverKey:
info.Role = mixTy.Role_SPENDER
info.AuthorizeSpendHash = mixTy.Byte2Str(mimcHashString([]string{rawData.ReceiverKey, rawData.Amount, rawData.NoteRandom}))
case rawData.ReturnKey:
info.Role = mixTy.Role_RETURNER
info.AuthorizeSpendHash = mixTy.Byte2Str(mimcHashString([]string{rawData.ReturnKey, rawData.Amount, rawData.NoteRandom}))
info.AuthorizeSpendHash = hex.EncodeToString(mimcHashString([]string{key.Privacy.PaymentKey.ReceiveKey, rawData.Amount, rawData.NoteRandom}))
case rawData.AuthorizeKey:
info.Role = mixTy.Role_AUTHORIZER
info.AuthorizeHash = hex.EncodeToString(mimcHashString([]string{rawData.AuthorizeKey, rawData.NoteRandom}))
}
}
......
......@@ -22,6 +22,7 @@ var boardOpt = &table.Option{
Index: []string{
"noteHash",
"nullifier",
"authHash",
"authSpendHash",
"account",
"status"},
......@@ -70,6 +71,8 @@ func (r *MixRow) Get(key string) ([]byte, error) {
return []byte(r.Info.NoteHash), nil
case "nullifier":
return []byte(r.Info.Nullifier), nil
case "authHash":
return []byte(r.Info.AuthorizeHash), nil
case "authSpendHash":
return []byte(r.Info.AuthorizeSpendHash), nil
case "account":
......
......@@ -22,31 +22,6 @@ type mixStore struct {
*wcom.Store
}
//
//func (store *mixStore) getAccountByPrefix(addr string) ([]*types.WalletAccountStore, error) {
// if len(addr) == 0 {
// bizlog.Error("getAccountByPrefix addr is nil")
// return nil, types.ErrInvalidParam
// }
// list := store.NewListHelper()
// accbytes := list.PrefixScan([]byte(addr))
// if len(accbytes) == 0 {
// bizlog.Error("getAccountByPrefix addr not exist")
// return nil, types.ErrAccountNotExist
// }
// WalletAccountStores := make([]*types.WalletAccountStore, len(accbytes))
// for index, accbyte := range accbytes {
// var walletaccount types.WalletAccountStore
// err := proto.Unmarshal(accbyte, &walletaccount)
// if err != nil {
// bizlog.Error("GetAccountByAddr", "proto.Unmarshal err:", err)
// return nil, types.ErrUnmarshal
// }
// WalletAccountStores[index] = &walletaccount
// }
// return WalletAccountStores, nil
//}
func (store *mixStore) getAccountPrivacy(addr string) ([]byte, error) {
if len(addr) == 0 {
return nil, types.ErrInvalidParam
......@@ -56,29 +31,6 @@ func (store *mixStore) getAccountPrivacy(addr string) ([]byte, error) {
}
//
//func (store *mixStore) getAccountByAddr(addr string) (*types.WalletAccountStore, error) {
// var account types.WalletAccountStore
// if len(addr) == 0 {
// bizlog.Error("GetAccountByAddr addr is nil")
// return nil, types.ErrInvalidParam
// }
// data, err := store.Get(calcMixAddrKey(addr))
// if data == nil || err != nil {
// if err != db.ErrNotFoundInDb {
// bizlog.Debug("GetAccountByAddr addr", "err", err)
// }
// return nil, types.ErrAddrNotExist
// }
//
// err = types.Decode(data, &account)
// if err != nil {
// bizlog.Error("GetAccountByAddr", "proto.Unmarshal err:", err)
// return nil, types.ErrUnmarshal
// }
// return &account, nil
//}
func (store *mixStore) setAccountPrivacy(addr string, data []byte) error {
if len(addr) == 0 {
bizlog.Error("SetWalletAccountPrivacy addr is nil")
......@@ -90,9 +42,6 @@ func (store *mixStore) setAccountPrivacy(addr string, data []byte) error {
}
store.GetDB().Set(calcMixAddrKey(addr), data)
//newbatch := store.NewBatch(true)
//newbatch.Set(calcMixAddrKey(addr), data)
//newbatch.Write()
return nil
}
......
......@@ -67,18 +67,20 @@ type AuthorizeInput struct {
Valid9 string `tag:"secret"`
}
func (policy *mixPolicy) getAuthParms(req *mixTy.AuthTxReq) (*AuthorizeInput, error) {
note, err := policy.getNoteInfo(req.NoteHash, mixTy.NoteStatus_FROZEN)
func (p *mixPolicy) getAuthParms(req *mixTy.AuthTxReq) (*AuthorizeInput, error) {
note, err := p.getNoteInfo(req.NoteHash)
if err != nil {
return nil, err
}
if note.Status != mixTy.NoteStatus_FROZEN {
return nil, errors.Wrapf(types.ErrNotAllow, "wrong note status=%s", note.Status.String())
}
if note.Secret.ReceiverKey != req.AuthorizeToAddr && note.Secret.ReturnKey != req.AuthorizeToAddr {
return nil, errors.Wrapf(types.ErrInvalidParam, "note no match addr to AuthorizeToAddr=%s", req.AuthorizeToAddr)
}
//get spend privacy key
privacyKey, err := policy.getAccountPrivacyKey(note.Account)
privacyKey, err := p.getAccountPrivacyKey(note.Account)
if err != nil {
return nil, errors.Wrapf(err, "getAccountPrivacyKey addr=%s", note.Account)
}
......@@ -110,7 +112,7 @@ func (policy *mixPolicy) getAuthParms(req *mixTy.AuthTxReq) (*AuthorizeInput, er
}
//get tree path
treeProof, err := policy.getTreeProof(note.NoteHash)
treeProof, err := p.getTreeProof(note.NoteHash)
if err != nil {
return nil, errors.Wrapf(err, "getTreeProof for hash=%s", note.NoteHash)
}
......@@ -121,13 +123,13 @@ func (policy *mixPolicy) getAuthParms(req *mixTy.AuthTxReq) (*AuthorizeInput, er
}
func (policy *mixPolicy) createAuthTx(req *mixTy.CreateRawTxReq) (*types.Transaction, error) {
func (p *mixPolicy) createAuthTx(req *mixTy.CreateRawTxReq) (*types.Transaction, error) {
var auth mixTy.AuthTxReq
err := types.Decode(req.Data, &auth)
if err != nil {
return nil, errors.Wrap(err, "decode req fail")
}
input, err := policy.getAuthParms(&auth)
input, err := p.getAuthParms(&auth)
if err != nil {
return nil, err
}
......@@ -137,18 +139,18 @@ func (policy *mixPolicy) createAuthTx(req *mixTy.CreateRawTxReq) (*types.Transac
return nil, errors.Wrapf(err, "getZkProofKeys note=%s", auth.NoteHash)
}
//verify
if err := policy.verifyProofOnChain(mixTy.VerifyType_AUTHORIZE, proofInfo, auth.ZkPath+mixTy.AuthVk); err != nil {
if err := p.verifyProofOnChain(mixTy.VerifyType_AUTHORIZE, proofInfo, auth.ZkPath+mixTy.AuthVk); err != nil {
return nil, errors.Wrapf(err, "verifyProof fail for note=%s", auth.NoteHash)
}
return policy.getAuthTx(strings.TrimSpace(req.Title+mixTy.MixX), proofInfo)
return p.getAuthTx(strings.TrimSpace(req.Title+mixTy.MixX), proofInfo)
}
func (policy *mixPolicy) getAuthTx(execName string, proof *mixTy.ZkProofInfo) (*types.Transaction, error) {
func (p *mixPolicy) getAuthTx(execName string, proof *mixTy.ZkProofInfo) (*types.Transaction, error) {
payload := &mixTy.MixAuthorizeAction{}
payload.Proof = proof
cfg := policy.getWalletOperate().GetAPI().GetConfig()
cfg := p.getWalletOperate().GetAPI().GetConfig()
action := &mixTy.MixAction{
Ty: mixTy.MixActionAuth,
Value: &mixTy.MixAction_Authorize{Authorize: payload},
......
......@@ -32,7 +32,12 @@ type DepositInput struct {
NoteRandom string `tag:"secret"`
}
func (policy *mixPolicy) depositParams(receiver, returner, auth, amount string) (*mixTy.DepositProofResp, error) {
func (p *mixPolicy) depositParams(receiver, returner, auth, amount string) (*mixTy.DepositProofResp, error) {
if receiver == returner || receiver == auth || returner == auth {
return nil, errors.Wrapf(types.ErrInvalidParam, "addrs should not be same to receiver=%s,return=%s,auth=%s",
receiver, returner, auth)
}
if len(receiver) <= 0 {
return nil, errors.Wrap(types.ErrInvalidParam, "receiver is nil")
}
......@@ -53,7 +58,7 @@ func (policy *mixPolicy) depositParams(receiver, returner, auth, amount string)
//TODO 线上检查是否随机值在nullifer里面
// 获取receiving addr对应的paymentKey
payKeys, e := policy.getPaymentKey(receiver)
payKeys, e := p.getPaymentKey(receiver)
if e != nil {
return nil, errors.Wrapf(e, "get payment key for addr = %s", receiver)
}
......@@ -65,7 +70,7 @@ func (policy *mixPolicy) depositParams(receiver, returner, auth, amount string)
//如果Input不填,缺省空为“0”字符串
secret.ReturnKey = "0"
if len(returner) > 0 {
returnKey, err = policy.getPaymentKey(returner)
returnKey, err = p.getPaymentKey(returner)
if err != nil {
return nil, errors.Wrapf(err, "get payment key for return addr = %s", returner)
}
......@@ -76,7 +81,7 @@ func (policy *mixPolicy) depositParams(receiver, returner, auth, amount string)
var authKey *mixTy.PaymentKey
secret.AuthorizeKey = "0"
if len(auth) > 0 {
authKey, err = policy.getPaymentKey(auth)
authKey, err = p.getPaymentKey(auth)
if err != nil {
return nil, errors.Wrapf(err, "get payment key for authorize addr = %s", auth)
}
......@@ -123,9 +128,9 @@ func (policy *mixPolicy) depositParams(receiver, returner, auth, amount string)
}
func (policy *mixPolicy) getDepositProof(receiver, returner, auth, amount, zkPath string) (*mixTy.ZkProofInfo, error) {
func (p *mixPolicy) getDepositProof(receiver, returner, auth, amount, zkPath string) (*mixTy.ZkProofInfo, error) {
resp, err := policy.depositParams(receiver, returner, auth, amount)
resp, err := p.depositParams(receiver, returner, auth, amount)
if err != nil {
return nil, err
}
......@@ -144,14 +149,14 @@ func (policy *mixPolicy) getDepositProof(receiver, returner, auth, amount, zkPat
}
//线上验证proof,失败的原因有可能circuit,Pk和线上vk不匹配,或不是一起产生的版本
if err := policy.verifyProofOnChain(mixTy.VerifyType_DEPOSIT, proofInfo, zkPath+mixTy.DepositVk); err != nil {
if err := p.verifyProofOnChain(mixTy.VerifyType_DEPOSIT, proofInfo, zkPath+mixTy.DepositVk); err != nil {
return nil, errors.Wrap(err, "verifyProof fail")
}
proofInfo.Secrets = resp.Secrets
return proofInfo, nil
}
func (policy *mixPolicy) createDepositTx(req *mixTy.CreateRawTxReq) (*types.Transaction, error) {
func (p *mixPolicy) createDepositTx(req *mixTy.CreateRawTxReq) (*types.Transaction, error) {
var deposit mixTy.DepositTxReq
err := types.Decode(req.Data, &deposit)
if err != nil {
......@@ -175,22 +180,22 @@ func (policy *mixPolicy) createDepositTx(req *mixTy.CreateRawTxReq) (*types.Tran
var proofs []*mixTy.ZkProofInfo
for i, rcv := range receivers {
p, err := policy.getDepositProof(rcv, deposit.Deposit.ReturnAddr, deposit.Deposit.AuthorizeAddr, amounts[i], deposit.ZkPath)
p, err := p.getDepositProof(rcv, deposit.Deposit.ReturnAddr, deposit.Deposit.AuthorizeAddr, amounts[i], deposit.ZkPath)
if err != nil {
return nil, errors.Wrapf(err, "get Deposit proof for=%s", rcv)
}
proofs = append(proofs, p)
}
return policy.getDepositTx(strings.TrimSpace(req.Title+mixTy.MixX), proofs)
return p.getDepositTx(strings.TrimSpace(req.Title+mixTy.MixX), proofs)
}
func (policy *mixPolicy) getDepositTx(execName string, proofs []*mixTy.ZkProofInfo) (*types.Transaction, error) {
func (p *mixPolicy) getDepositTx(execName string, proofs []*mixTy.ZkProofInfo) (*types.Transaction, error) {
payload := &mixTy.MixDepositAction{}
payload.Proofs = proofs
cfg := policy.getWalletOperate().GetAPI().GetConfig()
cfg := p.getWalletOperate().GetAPI().GetConfig()
action := &mixTy.MixAction{
Ty: mixTy.MixActionDeposit,
Value: &mixTy.MixAction_Deposit{Deposit: payload},
......
......@@ -92,10 +92,10 @@ type TransferOutput struct {
AmountRandom string `tag:"secret"`
}
func (policy *mixPolicy) getTransferInputPart(note *mixTy.WalletIndexInfo) (*TransferInput, error) {
func (p *mixPolicy) getTransferInputPart(note *mixTy.WalletNoteInfo) (*TransferInput, error) {
//get spend privacy key
privacyKey, err := policy.getAccountPrivacyKey(note.Account)
privacyKey, err := p.getAccountPrivacyKey(note.Account)
if err != nil {
return nil, errors.Wrapf(err, "getAccountPrivacyKey addr=%s", note.Account)
}
......@@ -133,7 +133,7 @@ func (policy *mixPolicy) getTransferInputPart(note *mixTy.WalletIndexInfo) (*Tra
input.AuthorizeFlag = "1"
}
treeProof, err := policy.getTreeProof(note.NoteHash)
treeProof, err := p.getTreeProof(note.NoteHash)
if err != nil {
return nil, errors.Wrapf(err, "getTreeProof for hash=%s", note.NoteHash)
}
......@@ -143,13 +143,13 @@ func (policy *mixPolicy) getTransferInputPart(note *mixTy.WalletIndexInfo) (*Tra
return &input, nil
}
func (policy *mixPolicy) getTransferOutput(req *mixTy.DepositInfo) (*TransferOutput, *mixTy.DHSecretGroup, error) {
func (p *mixPolicy) getTransferOutput(req *mixTy.DepositInfo) (*TransferOutput, *mixTy.DHSecretGroup, error) {
//目前只支持一个ReceiverAddr
if strings.Contains(req.ReceiverAddrs, ",") || strings.Contains(req.Amounts, ",") {
return nil, nil, errors.Wrapf(types.ErrInvalidParam, "only support one addr or amount,addrs=%s,amount=%s",
req.ReceiverAddrs, req.Amounts)
}
resp, err := policy.depositParams(req.ReceiverAddrs, req.ReturnAddr, req.AuthorizeAddr, req.Amounts)
resp, err := p.depositParams(req.ReceiverAddrs, req.ReturnAddr, req.AuthorizeAddr, req.Amounts)
if err != nil {
return nil, nil, errors.Wrapf(err, "deposit toAddr=%s", req.ReceiverAddrs)
}
......@@ -269,7 +269,7 @@ func getShieldValue(inputAmounts []uint64, outAmount, change, minTxFee uint64) (
return rst, nil
}
func (policy *mixPolicy) createTransferTx(req *mixTy.CreateRawTxReq) (*types.Transaction, error) {
func (p *mixPolicy) createTransferTx(req *mixTy.CreateRawTxReq) (*types.Transaction, error) {
var transfer mixTy.TransferTxReq
err := types.Decode(req.Data, &transfer)
if err != nil {
......@@ -277,19 +277,22 @@ func (policy *mixPolicy) createTransferTx(req *mixTy.CreateRawTxReq) (*types.Tra
}
noteHashs := strings.Split(transfer.GetInput().NoteHashs, ",")
var notes []*mixTy.WalletIndexInfo
var notes []*mixTy.WalletNoteInfo
for _, h := range noteHashs {
note, err := policy.getNoteInfo(h, mixTy.NoteStatus_VALID)
note, err := p.getNoteInfo(h)
if err != nil {
return nil, errors.Wrapf(err, "get note info for=%s", h)
}
if note.Status != mixTy.NoteStatus_VALID && note.Status != mixTy.NoteStatus_UNFROZEN {
return nil, errors.Wrapf(types.ErrNotAllow, "wrong note status=%s", note.Status.String())
}
notes = append(notes, note)
}
//1.获取Input
var inputParts []*TransferInput
for _, n := range notes {
input, err := policy.getTransferInputPart(n)
input, err := p.getTransferInputPart(n)
if err != nil {
return nil, errors.Wrapf(err, "getTransferInputPart note=%s", n.NoteHash)
}
......@@ -319,7 +322,7 @@ func (policy *mixPolicy) createTransferTx(req *mixTy.CreateRawTxReq) (*types.Tra
if sumInput < outAmount+uint64(mixTy.Privacy2PrivacyTxFee) {
return nil, errors.Wrapf(types.ErrInvalidParam, "out amount=%d big than input=%d - fee=%d", outAmount, sumInput, uint64(mixTy.Privacy2PrivacyTxFee))
}
outPart, outDHSecret, err := policy.getTransferOutput(transfer.Output.Deposit)
outPart, outDHSecret, err := p.getTransferOutput(transfer.Output.Deposit)
if err != nil {
return nil, errors.Wrap(err, "getTransferOutput for deposit")
}
......@@ -333,7 +336,7 @@ func (policy *mixPolicy) createTransferTx(req *mixTy.CreateRawTxReq) (*types.Tra
ReceiverAddrs: notes[0].Account,
Amounts: strconv.FormatUint(changeAmount, 10),
}
changePart, changeDHSecret, err := policy.getTransferOutput(change)
changePart, changeDHSecret, err := p.getTransferOutput(change)
if err != nil {
return nil, errors.Wrap(err, "getTransferOutput change part ")
}
......@@ -368,7 +371,7 @@ func (policy *mixPolicy) createTransferTx(req *mixTy.CreateRawTxReq) (*types.Tra
if err != nil {
return nil, errors.Wrapf(err, "verify.input getZkProofKeys,the i=%d", i)
}
if err := policy.verifyProofOnChain(mixTy.VerifyType_TRANSFERINPUT, inputProof, transfer.Input.ZkPath+mixTy.TransInputVk); err != nil {
if err := p.verifyProofOnChain(mixTy.VerifyType_TRANSFERINPUT, inputProof, transfer.Input.ZkPath+mixTy.TransInputVk); err != nil {
return nil, errors.Wrapf(err, "input verifyProof fail,the i=%d", i)
}
inputProofs = append(inputProofs, inputProof)
......@@ -379,7 +382,7 @@ func (policy *mixPolicy) createTransferTx(req *mixTy.CreateRawTxReq) (*types.Tra
if err != nil {
return nil, errors.Wrapf(err, "output getZkProofKeys")
}
if err := policy.verifyProofOnChain(mixTy.VerifyType_TRANSFEROUTPUT, outputProof, transfer.Output.ZkPath+mixTy.TransOutputVk); err != nil {
if err := p.verifyProofOnChain(mixTy.VerifyType_TRANSFEROUTPUT, outputProof, transfer.Output.ZkPath+mixTy.TransOutputVk); err != nil {
return nil, errors.Wrapf(err, "output verifyProof fail")
}
outputProof.Secrets = outDHSecret
......@@ -389,21 +392,21 @@ func (policy *mixPolicy) createTransferTx(req *mixTy.CreateRawTxReq) (*types.Tra
if err != nil {
return nil, errors.Wrapf(err, "change getZkProofKeys")
}
if err := policy.verifyProofOnChain(mixTy.VerifyType_TRANSFEROUTPUT, changeProof, transfer.Output.ZkPath+mixTy.TransOutputVk); err != nil {
if err := p.verifyProofOnChain(mixTy.VerifyType_TRANSFEROUTPUT, changeProof, transfer.Output.ZkPath+mixTy.TransOutputVk); err != nil {
return nil, errors.Wrapf(err, "change verifyProof fail")
}
changeProof.Secrets = changeDHSecret
return policy.getTransferTx(strings.TrimSpace(req.Title+mixTy.MixX), inputProofs, outputProof, changeProof)
return p.getTransferTx(strings.TrimSpace(req.Title+mixTy.MixX), inputProofs, outputProof, changeProof)
}
func (policy *mixPolicy) getTransferTx(execName string, inputProofs []*mixTy.ZkProofInfo, proofs ...*mixTy.ZkProofInfo) (*types.Transaction, error) {
func (p *mixPolicy) getTransferTx(execName string, inputProofs []*mixTy.ZkProofInfo, proofs ...*mixTy.ZkProofInfo) (*types.Transaction, error) {
payload := &mixTy.MixTransferAction{}
payload.Inputs = inputProofs
payload.Output = proofs[1]
payload.Change = proofs[2]
cfg := policy.getWalletOperate().GetAPI().GetConfig()
cfg := p.getWalletOperate().GetAPI().GetConfig()
action := &mixTy.MixAction{
Ty: mixTy.MixActionTransfer,
Value: &mixTy.MixAction_Transfer{Transfer: payload},
......
......@@ -67,11 +67,14 @@ type WithdrawInput struct {
Valid9 string `tag:"secret"`
}
func (policy *mixPolicy) getWithdrawParams(noteHash string) (*WithdrawInput, error) {
note, err := policy.getNoteInfo(noteHash, mixTy.NoteStatus_VALID)
func (p *mixPolicy) getWithdrawParams(noteHash string) (*WithdrawInput, error) {
note, err := p.getNoteInfo(noteHash)
if err != nil {
return nil, err
}
if note.Status != mixTy.NoteStatus_VALID && note.Status != mixTy.NoteStatus_UNFROZEN {
return nil, errors.Wrapf(types.ErrNotAllow, "wrong note status=%s", note.Status.String())
}
var input WithdrawInput
initTreePath(&input)
......@@ -85,24 +88,24 @@ func (policy *mixPolicy) getWithdrawParams(noteHash string) (*WithdrawInput, err
input.AuthorizePubKey = note.Secret.AuthorizeKey
input.NoteRandom = note.Secret.NoteRandom
input.SpendFlag = "1"
if note.Role == mixTy.Role_RETURNER {
input.SpendFlag = "0"
}
input.AuthorizeFlag = "0"
if len(input.AuthorizeSpendHash) > LENNULLKEY {
input.AuthorizeFlag = "1"
}
//get spend privacy key
privacyKey, err := policy.getAccountPrivacyKey(note.Account)
privacyKey, err := p.getAccountPrivacyKey(note.Account)
if err != nil {
return nil, errors.Wrapf(err, "getAccountPrivacyKey addr=%s", note.Account)
}
input.SpendPriKey = privacyKey.Privacy.PaymentKey.SpendKey
input.SpendFlag = "1"
if privacyKey.Privacy.PaymentKey.ReceiveKey == input.ReturnPubKey {
input.SpendFlag = "0"
}
//get tree path
treeProof, err := policy.getTreeProof(note.NoteHash)
treeProof, err := p.getTreeProof(note.NoteHash)
if err != nil {
return nil, errors.Wrapf(err, "getTreeProof for hash=%s", note.NoteHash)
}
......@@ -113,7 +116,7 @@ func (policy *mixPolicy) getWithdrawParams(noteHash string) (*WithdrawInput, err
}
func (policy *mixPolicy) createWithdrawTx(req *mixTy.CreateRawTxReq) (*types.Transaction, error) {
func (p *mixPolicy) createWithdrawTx(req *mixTy.CreateRawTxReq) (*types.Transaction, error) {
var withdraw mixTy.WithdrawTxReq
err := types.Decode(req.Data, &withdraw)
if err != nil {
......@@ -131,7 +134,7 @@ func (policy *mixPolicy) createWithdrawTx(req *mixTy.CreateRawTxReq) (*types.Tra
var sum uint64
for _, note := range notes {
input, err := policy.getWithdrawParams(note)
input, err := p.getWithdrawParams(note)
if err != nil {
return nil, errors.Wrapf(err, "getWithdrawParams note=%s", note)
}
......@@ -141,7 +144,7 @@ func (policy *mixPolicy) createWithdrawTx(req *mixTy.CreateRawTxReq) (*types.Tra
return nil, errors.Wrapf(err, "getZkProofKeys note=%s", note)
}
//verify
if err := policy.verifyProofOnChain(mixTy.VerifyType_WITHDRAW, proofInfo, withdraw.ZkPath+mixTy.WithdrawVk); err != nil {
if err := p.verifyProofOnChain(mixTy.VerifyType_WITHDRAW, proofInfo, withdraw.ZkPath+mixTy.WithdrawVk); err != nil {
return nil, errors.Wrapf(err, "verifyProof fail for note=%s", note)
}
......@@ -158,16 +161,16 @@ func (policy *mixPolicy) createWithdrawTx(req *mixTy.CreateRawTxReq) (*types.Tra
return nil, errors.Wrapf(types.ErrInvalidParam, "amount not match req=%d,note.sum=%d", withdraw.TotalAmount, sum)
}
return policy.getWithdrawTx(strings.TrimSpace(req.Title+mixTy.MixX), withdraw.TotalAmount, proofs)
return p.getWithdrawTx(strings.TrimSpace(req.Title+mixTy.MixX), withdraw.TotalAmount, proofs)
}
func (policy *mixPolicy) getWithdrawTx(execName string, amount uint64, proofs []*mixTy.ZkProofInfo) (*types.Transaction, error) {
func (p *mixPolicy) getWithdrawTx(execName string, amount uint64, proofs []*mixTy.ZkProofInfo) (*types.Transaction, error) {
payload := &mixTy.MixWithdrawAction{}
payload.Amount = amount
payload.Proofs = proofs
cfg := policy.getWalletOperate().GetAPI().GetConfig()
cfg := p.getWalletOperate().GetAPI().GetConfig()
action := &mixTy.MixAction{
Ty: mixTy.MixActionWithdraw,
Value: &mixTy.MixAction_Withdraw{Withdraw: payload},
......
......@@ -87,7 +87,7 @@ func decryptSecretData(req *mixTy.DecryptSecretData) (*mixTy.SecretData, error)
return &raw, nil
}
func (policy *mixPolicy) verifyProofOnChain(ty mixTy.VerifyType, proof *mixTy.ZkProofInfo, vkPath string) error {
func (p *mixPolicy) verifyProofOnChain(ty mixTy.VerifyType, proof *mixTy.ZkProofInfo, vkPath string) error {
//vkpath verify
if len(vkPath) > 0 {
vk, err := getVerifyKey(vkPath)
......@@ -111,7 +111,7 @@ func (policy *mixPolicy) verifyProofOnChain(ty mixTy.VerifyType, proof *mixTy.Zk
Proof: proof,
}
//onchain verify
_, err := policy.walletOperate.GetAPI().QueryChain(&types.ChainExecutor{
_, err := p.walletOperate.GetAPI().QueryChain(&types.ChainExecutor{
Driver: "mix",
FuncName: "VerifyProof",
Param: types.Encode(verify),
......@@ -119,8 +119,8 @@ func (policy *mixPolicy) verifyProofOnChain(ty mixTy.VerifyType, proof *mixTy.Zk
return err
}
func (policy *mixPolicy) getPaymentKey(addr string) (*mixTy.PaymentKey, error) {
msg, err := policy.walletOperate.GetAPI().QueryChain(&types.ChainExecutor{
func (p *mixPolicy) getPaymentKey(addr string) (*mixTy.PaymentKey, error) {
msg, err := p.walletOperate.GetAPI().QueryChain(&types.ChainExecutor{
Driver: "mix",
FuncName: "PaymentPubKey",
Param: types.Encode(&types.ReqString{Data: addr}),
......@@ -131,8 +131,8 @@ func (policy *mixPolicy) getPaymentKey(addr string) (*mixTy.PaymentKey, error) {
return msg.(*mixTy.PaymentKey), err
}
func (policy *mixPolicy) getPathProof(leaf string) (*mixTy.CommitTreeProve, error) {
msg, err := policy.walletOperate.GetAPI().QueryChain(&types.ChainExecutor{
func (p *mixPolicy) getPathProof(leaf string) (*mixTy.CommitTreeProve, error) {
msg, err := p.walletOperate.GetAPI().QueryChain(&types.ChainExecutor{
Driver: "mix",
FuncName: "GetTreePath",
Param: types.Encode(&mixTy.TreeInfoReq{LeafHash: leaf}),
......@@ -143,32 +143,30 @@ func (policy *mixPolicy) getPathProof(leaf string) (*mixTy.CommitTreeProve, erro
return msg.(*mixTy.CommitTreeProve), nil
}
func (policy *mixPolicy) getNoteInfo(noteHash string, noteStatus mixTy.NoteStatus) (*mixTy.WalletIndexInfo, error) {
if policy.walletOperate.IsWalletLocked() {
func (p *mixPolicy) getNoteInfo(noteHash string) (*mixTy.WalletNoteInfo, error) {
if p.walletOperate.IsWalletLocked() {
return nil, types.ErrWalletIsLocked
}
var index mixTy.WalletMixIndexReq
index.NoteHash = noteHash
msg, err := policy.listMixInfos(&index)
msg, err := p.listMixInfos(&index)
if err != nil {
return nil, errors.Wrapf(err, "list noteHash=%s", noteHash)
}
resp := msg.(*mixTy.WalletIndexResp)
resp := msg.(*mixTy.WalletNoteResp)
if len(resp.Notes) < 1 {
return nil, errors.Wrapf(err, "list not found noteHash=%s", noteHash)
}
note := msg.(*mixTy.WalletIndexResp).Notes[0]
if note.Status != noteStatus {
return nil, errors.Wrapf(types.ErrNotAllow, "wrong note status=%s", note.Status.String())
}
note := msg.(*mixTy.WalletNoteResp).Notes[0]
return note, nil
}
func (policy *mixPolicy) getTreeProof(leaf string) (*mixTy.TreePathProof, error) {
func (p *mixPolicy) getTreeProof(leaf string) (*mixTy.TreePathProof, error) {
//get tree path
path, err := policy.getPathProof(leaf)
path, err := p.getPathProof(leaf)
if err != nil {
return nil, errors.Wrapf(err, "get tree proof for noteHash=%s", leaf)
}
......
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