Commit 659d1455 authored by suyanlong's avatar suyanlong

😘 insteadof go mod path

parent 502e5138
Language: 'Proto'
BasedOnStyle: 'LLVM'
AccessModifierOffset: '-1'
AlignAfterOpenBracket: 'Align'
AlignConsecutiveAssignments: 'true'
AlignConsecutiveDeclarations: 'true'
AlignEscapedNewlinesLeft: 'true'
AlignOperands: 'true'
AlignTrailingComments: 'true'
AllowAllParametersOfDeclarationOnNextLine: 'true'
AllowShortBlocksOnASingleLine: 'true'
AllowShortCaseLabelsOnASingleLine: 'true'
ColumnLimit: '200'
IndentWidth: '4'
ContinuationIndentWidth: '4'
TabWidth: '4'
TabWidth: '4'
ReflowComments: 'true'
SortIncludes: 'true'
AllowShortFunctionsOnASingleLine: 'Empty'
AllowShortIfStatementsOnASingleLine: 'true'
test/*
plugins/build
Dockerfile
\ No newline at end of file
root = true
[*]
charset = utf-8
end_of_line = LF
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 8
[Makefile]
indent_size = 4
indent_style = tab
[*.md]
trim_trailing_whitespace = false
[*.go]
indent_style = tab
[*.yml]
indent_style = space
indent_size = 2
[*.sh]
indent_style = space
indent_size = 2
.DS_Store
.idea/*
*.tar
logs/*
internal/repo/a_repo-packr.go
bin
cover.out
coverage.out
coverage.txt
cover.html
imports/imports.go
goent.mod
goent.sum
testdata/
!internal/checker/testdata
pkg/filter/build/
# golang1.17.1 or latest
# 1. make help
# 2. make build
# ...
.PHONY: all build test fmt vet clean help
RED=\033[0;31m
GREEN=\033[0;32m
BLUE=\033[0;34m
NC=\033[0m
build:
@go mod tidy -v
@go build -v ./...
@printf "${GREEN}Build successfully!${NC}\n"
.PHONY: test fmt_proto fmt_shell check checkgofmt
help: Makefile
@echo "Choose a command run:"
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
## make test: Run go unittest
test:
go generate ./...
@$(GO) test ${TEST_PKGS} -count=1
mod:
sed "s?)?$(MODS)\n)?" go.mod
## make linter: Run golanci-lint
linter:
golangci-lint run
golangci-lint run -E goimports -E bodyclose --skip-dirs-use-default
fmt_proto: ## go fmt protobuf file
@find . -name '*.proto' -not -path "./vendor/*" | xargs clang-format -i
fmt_shell: ## check shell file
@find . -name '*.sh' -not -path "./vendor/*" | xargs shfmt -w -s -i 4 -ci -bn
fmt_go: fmt_shell ## go fmt
@go fmt ./...
@find . -name '*.go' -not -path "./vendor/*" | xargs goimports -l -w
goimports:fmt
@CGO_ENABLED=1 goimports-reviser -dir-path ./ -project-name gitlab.33.cn/link33/chain33-sdk-go -ignore-dir mock -rm-unused -set-alias -format
fmt: fmt_proto fmt_shell ## go fmt
@go fmt ./...
@find . -name '*.go' -not -path "./vendor/*" | xargs goimports -l -w
@gofumpt -l -w .
clean:
@go clean
build-dep:
@go install golang.org/x/tools/cmd/goimports@latest
@go install github.com/suyanlong/aligner@latest
@go install mvdan.cc/gofumpt@latest
@go install mvdan.cc/sh/v3/cmd/shfmt@latest
@go install mvdan.cc/sh/v3/cmd/gosh@latest
@go install mvdan.cc/unparam@latest
@go install github.com/incu6us/goimports-reviser@master
@go install github.com/psampaz/go-mod-outdated@v0.8.0
# @apt install clang-format or brew isntall clang-format
# @apt install shellcheck or brew install shellcheck
aligner:
@aligner -r -c "//" -e ".go" comment
aligner-check:
@aligner -r -c "//" -e ".go" check
checkgofmt: ## get all go files and run go fmt on them
@files=$$(find . -name '*.go' -not -path "./vendor/*" | xargs gofmt -l -s); if [ -n "$$files" ]; then \
echo "Error: 'make fmt' needs to be run on:"; \
find . -name '*.go' -not -path "./vendor/*" | xargs gofmt -l -s ;\
exit 1; \
fi;
@files=$$(find . -name '*.go' -not -path "./vendor/*" | xargs goimports -l -w); if [ -n "$$files" ]; then \
echo "Error: 'make fmt' needs to be run on:"; \
find . -name '*.go' -not -path "./vendor/*" | xargs goimports -l -w ;\
exit 1; \
fi;
check: aligner-check checkgofmt
modmated:
@go list -u -m -json all | go-mod-outdated
...@@ -2,32 +2,33 @@ package sdk ...@@ -2,32 +2,33 @@ package sdk
import ( import (
"errors" "errors"
"github.com/33cn/chain33-sdk-go/crypto"
"github.com/33cn/chain33-sdk-go/crypto/ed25519"
"github.com/33cn/chain33-sdk-go/crypto/gm"
"github.com/33cn/chain33-sdk-go/types"
log "github.com/inconshreveable/log15" log "github.com/inconshreveable/log15"
"gitlab.33.cn/link33/chain33-sdk-go/crypto"
"gitlab.33.cn/link33/chain33-sdk-go/crypto/ed25519"
"gitlab.33.cn/link33/chain33-sdk-go/crypto/gm"
"gitlab.33.cn/link33/chain33-sdk-go/types"
) )
type Account struct { type Account struct {
PrivateKey []byte PrivateKey []byte
PublicKey []byte PublicKey []byte
Address string Address string
SignType string SignType string
} }
var rlog = log.New("module", "chain33 adk") var rlog = log.New("module", "chain33 adk")
func NewAccount(signType string) (*Account, error) { func NewAccount(signType string) (*Account, error) {
if signType == "" { if signType == "" {
signType = crypto.SECP256K1 signType = crypto.SECP256K1
} }
account := Account{} account := Account{}
account.SignType = signType account.SignType = signType
if signType == crypto.SECP256K1 { if signType == crypto.SECP256K1 {
account.PrivateKey = crypto.GeneratePrivateKey() account.PrivateKey = crypto.GeneratePrivateKey()
account.PublicKey = crypto.PubKeyFromPrivate(account.PrivateKey) account.PublicKey = crypto.PubKeyFromPrivate(account.PrivateKey)
addr, err := crypto.PubKeyToAddress(account.PublicKey) addr, err := crypto.PubKeyToAddress(account.PublicKey)
if err != nil { if err != nil {
...@@ -75,7 +76,7 @@ func NewAccountFromLocal(signType string, filePath string) (*Account, error) { ...@@ -75,7 +76,7 @@ func NewAccountFromLocal(signType string, filePath string) (*Account, error) {
account.SignType = signType account.SignType = signType
if signType == crypto.SECP256K1 { if signType == crypto.SECP256K1 {
//TODO // TODO
return nil, errors.New("not support") return nil, errors.New("not support")
} else if signType == crypto.SM2 { } else if signType == crypto.SM2 {
content, err := types.ReadFile(filePath) content, err := types.ReadFile(filePath)
...@@ -84,7 +85,7 @@ func NewAccountFromLocal(signType string, filePath string) (*Account, error) { ...@@ -84,7 +85,7 @@ func NewAccountFromLocal(signType string, filePath string) (*Account, error) {
return nil, err return nil, err
} }
keyBytes,err := types.FromHex(string(content)) keyBytes, err := types.FromHex(string(content))
if err != nil { if err != nil {
rlog.Error("GetKeyByte.FromHex.", "error", err.Error()) rlog.Error("GetKeyByte.FromHex.", "error", err.Error())
return nil, err return nil, err
......
package client package client
const ( const (
Chain33_Lock = "Chain33.Lock" Chain33_Lock = "Chain33.Lock"
Chain33_UnLock = "Chain33.UnLock" Chain33_UnLock = "Chain33.UnLock"
...@@ -40,4 +41,4 @@ const ( ...@@ -40,4 +41,4 @@ const (
Chain33_Query = "Chain33.Query" Chain33_Query = "Chain33.Query"
Para_IsSync = "paracross.IsSync" Para_IsSync = "paracross.IsSync"
Chain33_IsSync = "Chain33.IsSync" Chain33_IsSync = "Chain33.IsSync"
) )
\ No newline at end of file
...@@ -11,18 +11,18 @@ import ( ...@@ -11,18 +11,18 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
sdk "github.com/33cn/chain33-sdk-go"
"github.com/33cn/chain33-sdk-go/crypto"
"github.com/33cn/chain33-sdk-go/dapp/broker"
"github.com/33cn/chain33-sdk-go/dapp/storage"
"github.com/33cn/chain33-sdk-go/event"
"github.com/33cn/chain33-sdk-go/types"
"github.com/golang/protobuf/proto"
"time"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"strings" "strings"
"time"
"github.com/golang/protobuf/proto"
sdk "gitlab.33.cn/link33/chain33-sdk-go"
"gitlab.33.cn/link33/chain33-sdk-go/crypto"
"gitlab.33.cn/link33/chain33-sdk-go/dapp/broker"
"gitlab.33.cn/link33/chain33-sdk-go/dapp/storage"
"gitlab.33.cn/link33/chain33-sdk-go/event"
"gitlab.33.cn/link33/chain33-sdk-go/types"
) )
// JSONClient a object of jsonclient // JSONClient a object of jsonclient
...@@ -48,7 +48,7 @@ func NewJSONClient(prefix, url string) (*JSONClient, error) { ...@@ -48,7 +48,7 @@ func NewJSONClient(prefix, url string) (*JSONClient, error) {
// New produce a jsonclient by perfix and url // New produce a jsonclient by perfix and url
func new(prefix, url string, tlsVerify bool) (*JSONClient, error) { func new(prefix, url string, tlsVerify bool) (*JSONClient, error) {
httpcli := http.DefaultClient httpcli := http.DefaultClient
if strings.Contains(url, "https") { //暂不校验tls证书 if strings.Contains(url, "https") { // 暂不校验tls证书
httpcli = &http.Client{Transport: &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: !tlsVerify}}} httpcli = &http.Client{Transport: &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: !tlsVerify}}}
} }
return &JSONClient{ return &JSONClient{
...@@ -129,7 +129,7 @@ func (client *JSONClient) Call(method string, params, resp interface{}) error { ...@@ -129,7 +129,7 @@ func (client *JSONClient) Call(method string, params, resp interface{}) error {
type ParseFunc func(result json.RawMessage) (interface{}, error) type ParseFunc func(result json.RawMessage) (interface{}, error)
//回调函数,用于自定义解析返回得result数据 // 回调函数,用于自定义解析返回得result数据
func (client *JSONClient) CallBack(method string, params interface{}, parseFunc ParseFunc) (interface{}, error) { func (client *JSONClient) CallBack(method string, params interface{}, parseFunc ParseFunc) (interface{}, error) {
method = addPrefix(client.prefix, method) method = addPrefix(client.prefix, method)
req := &clientRequest{} req := &clientRequest{}
...@@ -184,9 +184,9 @@ func (client *JSONClient) SendTransaction(signedTx string) (string, error) { ...@@ -184,9 +184,9 @@ func (client *JSONClient) SendTransaction(signedTx string) (string, error) {
return res, nil return res, nil
} }
//SendTransactionSync // SendTransactionSync
func (client *JSONClient) SendTransactionSync(privkey string,tx *types.Transaction) (*Response, error) { func (client *JSONClient) SendTransactionSync(privkey string, tx *types.Transaction) (*Response, error) {
//签名 // 签名
hexbytes, _ := types.FromHex(privkey) hexbytes, _ := types.FromHex(privkey)
sdk.Sign(tx, hexbytes, crypto.SECP256K1, nil) sdk.Sign(tx, hexbytes, crypto.SECP256K1, nil)
signedTx := types.ToHexPrefix(types.Encode(tx)) signedTx := types.ToHexPrefix(types.Encode(tx))
...@@ -199,7 +199,7 @@ func (client *JSONClient) SendTransactionSync(privkey string,tx *types.Transacti ...@@ -199,7 +199,7 @@ func (client *JSONClient) SendTransactionSync(privkey string,tx *types.Transacti
if err != nil { if err != nil {
return nil, err return nil, err
} }
return &Response{OK:true,Message:res,Data:types.Encode(tx)}, nil return &Response{OK: true, Message: res, Data: types.Encode(tx)}, nil
} }
// 查询交易 // 查询交易
...@@ -250,6 +250,7 @@ func (client *JSONClient) QueryHeadersByHeight(height int64) (*Headers, error) { ...@@ -250,6 +250,7 @@ func (client *JSONClient) QueryHeadersByHeight(height int64) (*Headers, error) {
} }
return &res, nil return &res, nil
} }
func (client *JSONClient) QueryIsSync() (bool, error) { func (client *JSONClient) QueryIsSync() (bool, error) {
var res bool var res bool
err := client.Call(Para_IsSync, nil, &res) err := client.Call(Para_IsSync, nil, &res)
...@@ -277,6 +278,7 @@ func (client *JSONClient) QueryNetInfo() (*NodeNetinfo, error) { ...@@ -277,6 +278,7 @@ func (client *JSONClient) QueryNetInfo() (*NodeNetinfo, error) {
} }
return &res, nil return &res, nil
} }
func (client *JSONClient) QueryMempool(jrpcURl string) (*ReplyTxList, error) { func (client *JSONClient) QueryMempool(jrpcURl string) (*ReplyTxList, error) {
var res ReplyTxList var res ReplyTxList
params := types.ReqNil{} params := types.ReqNil{}
...@@ -287,7 +289,7 @@ func (client *JSONClient) QueryMempool(jrpcURl string) (*ReplyTxList, error) { ...@@ -287,7 +289,7 @@ func (client *JSONClient) QueryMempool(jrpcURl string) (*ReplyTxList, error) {
return &res, nil return &res, nil
} }
//获取区块信息 // 获取区块信息
func (client *JSONClient) QueryBlockInfo(start, end int64, isDetail bool) (*BlockDetails, error) { func (client *JSONClient) QueryBlockInfo(start, end int64, isDetail bool) (*BlockDetails, error) {
var res BlockDetails var res BlockDetails
params := BlockParam{Start: start, End: end, Isdetail: isDetail} params := BlockParam{Start: start, End: end, Isdetail: isDetail}
...@@ -297,25 +299,25 @@ func (client *JSONClient) QueryBlockInfo(start, end int64, isDetail bool) (*Bloc ...@@ -297,25 +299,25 @@ func (client *JSONClient) QueryBlockInfo(start, end int64, isDetail bool) (*Bloc
} }
return &res, nil return &res, nil
} }
//调用chaincode
func (client *JSONClient) Invoke(requst *Request,privateKey string) (*Response, error) {
//FIXME 这里需完善
if requst.Exec == storage.StorageX{
switch requst.Fcn {
case "set","ContentStorage": // 调用chaincode
tx,err:=storage.CreateContentStorageTx(client.prefix,0,string(requst.Args[0]),nil,string(requst.Args[1])) func (client *JSONClient) Invoke(requst *Request, privateKey string) (*Response, error) {
if err!=nil { // FIXME 这里需完善
return nil,err if requst.Exec == storage.StorageX {
switch requst.Fcn {
case "set", "ContentStorage":
tx, err := storage.CreateContentStorageTx(client.prefix, 0, string(requst.Args[0]), nil, string(requst.Args[1]))
if err != nil {
return nil, err
} }
return client.SendTransactionSync(privateKey,tx) return client.SendTransactionSync(privateKey, tx)
} }
} }
return nil, fmt.Errorf("not matching execution or method!") return nil, fmt.Errorf("not matching execution or method!")
} }
// TODO 执行请求 // TODO 执行请求
func (client *JSONClient) Execute(requst *Request) (*Response, error) { func (client *JSONClient) Execute(requst *Request) (*Response, error) {
//err := client.Call(Chain33_QueryTransaction, query, &detail) //err := client.Call(Chain33_QueryTransaction, query, &detail)
//if err != nil { //if err != nil {
// return nil, err // return nil, err
...@@ -330,7 +332,7 @@ func (client *JSONClient) RegisterTxEvent(start int64, ccID, eventFilter string) ...@@ -330,7 +332,7 @@ func (client *JSONClient) RegisterTxEvent(start int64, ccID, eventFilter string)
ch := make(chan *event.CCEvent) ch := make(chan *event.CCEvent)
resCh := make(chan event.Registration) resCh := make(chan event.Registration)
errCh := make(chan error) errCh := make(chan error)
//FIXME 这里实现是以联盟链方式,联盟链没有回滚,所以这里暂时按高度拉去处理 // FIXME 这里实现是以联盟链方式,联盟链没有回滚,所以这里暂时按高度拉去处理
go func(ch chan<- *event.CCEvent, closeCh <-chan event.Registration, errCh chan<- error) { go func(ch chan<- *event.CCEvent, closeCh <-chan event.Registration, errCh chan<- error) {
height := start height := start
HERE: HERE:
...@@ -357,7 +359,7 @@ func (client *JSONClient) RegisterTxEvent(start int64, ccID, eventFilter string) ...@@ -357,7 +359,7 @@ func (client *JSONClient) RegisterTxEvent(start int64, ccID, eventFilter string)
for _, item := range blockInfo.Items { for _, item := range blockInfo.Items {
for i, tx := range item.Block.Txs { for i, tx := range item.Block.Txs {
if tx.Execer == ccID && item.Receipts[i].Ty == types.ExecOk { if tx.Execer == ccID && item.Receipts[i].Ty == types.ExecOk {
//todo 这里需要重新弄成通用处理 // todo 这里需要重新弄成通用处理
if tx.Execer == broker.BrokerX { if tx.Execer == broker.BrokerX {
var brokerAction types.BrokerAction var brokerAction types.BrokerAction
err := types.Decode(tx.Payload, &brokerAction) err := types.Decode(tx.Payload, &brokerAction)
...@@ -371,7 +373,6 @@ func (client *JSONClient) RegisterTxEvent(start int64, ccID, eventFilter string) ...@@ -371,7 +373,6 @@ func (client *JSONClient) RegisterTxEvent(start int64, ccID, eventFilter string)
ch <- ccEvent ch <- ccEvent
} }
} }
} }
} }
} }
...@@ -381,7 +382,6 @@ func (client *JSONClient) RegisterTxEvent(start int64, ccID, eventFilter string) ...@@ -381,7 +382,6 @@ func (client *JSONClient) RegisterTxEvent(start int64, ccID, eventFilter string)
case <-closeCh: case <-closeCh:
break break
} }
} }
}(ch, resCh, errCh) }(ch, resCh, errCh)
return resCh, ch, nil return resCh, ch, nil
...@@ -442,7 +442,6 @@ func (client *JSONClient) QueryOutterMeta() (*types.Meta, error) { ...@@ -442,7 +442,6 @@ func (client *JSONClient) QueryOutterMeta() (*types.Meta, error) {
} }
func (client *JSONClient) QueryCallBackMeta() (*types.Meta, error) { func (client *JSONClient) QueryCallBackMeta() (*types.Meta, error) {
jsonraw, err := json.Marshal(&types.QueryNilParam{}) jsonraw, err := json.Marshal(&types.QueryNilParam{})
if err != nil { if err != nil {
return nil, err return nil, err
...@@ -479,7 +478,6 @@ func (client *JSONClient) QueryOutMessage(inServicePair string, index uint64) (* ...@@ -479,7 +478,6 @@ func (client *JSONClient) QueryOutMessage(inServicePair string, index uint64) (*
} }
func (client *JSONClient) QueryInMessage(inServicePair string, index uint64) (*types.Response, error) { func (client *JSONClient) QueryInMessage(inServicePair string, index uint64) (*types.Response, error) {
jsonraw, err := json.Marshal(&types.QueryInMessage{InServicePair: inServicePair, SequenceNum: index}) jsonraw, err := json.Marshal(&types.QueryInMessage{InServicePair: inServicePair, SequenceNum: index})
if err != nil { if err != nil {
return nil, err return nil, err
...@@ -498,7 +496,6 @@ func (client *JSONClient) QueryInMessage(inServicePair string, index uint64) (*t ...@@ -498,7 +496,6 @@ func (client *JSONClient) QueryInMessage(inServicePair string, index uint64) (*t
} }
func (client *JSONClient) QueryBrokerInfo() (*types.BrokerInfo, error) { func (client *JSONClient) QueryBrokerInfo() (*types.BrokerInfo, error) {
jsonraw, err := json.Marshal(&types.QueryNilParam{}) jsonraw, err := json.Marshal(&types.QueryNilParam{})
if err != nil { if err != nil {
return nil, err return nil, err
......
...@@ -106,6 +106,7 @@ type Header struct { ...@@ -106,6 +106,7 @@ type Header struct {
TxCount int64 `json:"txCount"` TxCount int64 `json:"txCount"`
Hash string `json:"hash"` Hash string `json:"hash"`
} }
type ReceiptLog struct { type ReceiptLog struct {
Ty int32 `json:"ty"` Ty int32 `json:"ty"`
Log string `json:"log"` Log string `json:"log"`
...@@ -158,7 +159,7 @@ type ReplyTxInfo struct { ...@@ -158,7 +159,7 @@ type ReplyTxInfo struct {
} }
type TransactionDetails struct { type TransactionDetails struct {
//Txs []*Transaction `json:"txs"` // Txs []*Transaction `json:"txs"`
Txs []*TransactionDetail `protobuf:"bytes,1,rep,name=txs" json:"txs"` Txs []*TransactionDetail `protobuf:"bytes,1,rep,name=txs" json:"txs"`
} }
...@@ -173,9 +174,11 @@ type ReplyHash struct { ...@@ -173,9 +174,11 @@ type ReplyHash struct {
type ReplyHashes struct { type ReplyHashes struct {
Hashes []string `json:"hashes"` Hashes []string `json:"hashes"`
} }
type PeerList struct { type PeerList struct {
Peers []*Peer `json:"peers"` Peers []*Peer `json:"peers"`
} }
type Peer struct { type Peer struct {
Addr string `json:"addr"` Addr string `json:"addr"`
Port int32 `json:"port"` Port int32 `json:"port"`
...@@ -189,6 +192,7 @@ type Peer struct { ...@@ -189,6 +192,7 @@ type Peer struct {
type WalletAccounts struct { type WalletAccounts struct {
Wallets []*WalletAccount `protobuf:"bytes,1,rep,name=wallets" json:"wallets"` Wallets []*WalletAccount `protobuf:"bytes,1,rep,name=wallets" json:"wallets"`
} }
type WalletAccount struct { type WalletAccount struct {
Acc *Account `protobuf:"bytes,1,opt,name=acc" json:"acc"` Acc *Account `protobuf:"bytes,1,opt,name=acc" json:"acc"`
Label string `protobuf:"bytes,2,opt,name=label" json:"label"` Label string `protobuf:"bytes,2,opt,name=label" json:"label"`
...@@ -200,10 +204,12 @@ type Account struct { ...@@ -200,10 +204,12 @@ type Account struct {
Frozen int64 `protobuf:"varint,3,opt,name=frozen" json:"frozen"` Frozen int64 `protobuf:"varint,3,opt,name=frozen" json:"frozen"`
Addr string `protobuf:"bytes,4,opt,name=addr" json:"addr"` Addr string `protobuf:"bytes,4,opt,name=addr" json:"addr"`
} }
type Reply struct { type Reply struct {
IsOk bool `protobuf:"varint,1,opt,name=isOk" json:"isOK"` IsOk bool `protobuf:"varint,1,opt,name=isOk" json:"isOK"`
Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg"` Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg"`
} }
type Headers struct { type Headers struct {
Items []*Header `protobuf:"bytes,1,rep,name=items" json:"items"` Items []*Header `protobuf:"bytes,1,rep,name=items" json:"items"`
} }
...@@ -222,9 +228,11 @@ type ReqWalletTransactionList struct { ...@@ -222,9 +228,11 @@ type ReqWalletTransactionList struct {
Count int32 `json:"count"` Count int32 `json:"count"`
Direction int32 `json:"direction"` Direction int32 `json:"direction"`
} }
type WalletTxDetails struct { type WalletTxDetails struct {
TxDetails []*WalletTxDetail `protobuf:"bytes,1,rep,name=txDetails" json:"txDetails"` TxDetails []*WalletTxDetail `protobuf:"bytes,1,rep,name=txDetails" json:"txDetails"`
} }
type WalletTxDetail struct { type WalletTxDetail struct {
Tx *Transaction `protobuf:"bytes,1,opt,name=tx" json:"tx"` Tx *Transaction `protobuf:"bytes,1,opt,name=tx" json:"tx"`
Receipt *ReceiptDataResult `protobuf:"bytes,2,opt,name=receipt" json:"receipt"` Receipt *ReceiptDataResult `protobuf:"bytes,2,opt,name=receipt" json:"receipt"`
...@@ -346,8 +354,9 @@ type Request struct { ...@@ -346,8 +354,9 @@ type Request struct {
Fcn string `json:"fcn"` Fcn string `json:"fcn"`
Args [][]byte `json:"args"` Args [][]byte `json:"args"`
} }
type Response struct { type Response struct {
OK bool `json:"ok"` OK bool `json:"ok"`
Message string `json:"message"` Message string `json:"message"`
Data []byte `json:"data"` Data []byte `json:"data"`
} }
\ No newline at end of file
...@@ -3,10 +3,11 @@ package crypto ...@@ -3,10 +3,11 @@ package crypto
import ( import (
"crypto/sha256" "crypto/sha256"
"fmt" "fmt"
"github.com/mr-tron/base58/base58" "github.com/mr-tron/base58/base58"
) )
//不同币种的前缀版本号 // 不同币种的前缀版本号
var coinPrefix = map[string][]byte{ var coinPrefix = map[string][]byte{
"BTC": {0x00}, "BTC": {0x00},
"BCH": {0x00}, "BCH": {0x00},
...@@ -18,27 +19,27 @@ var coinPrefix = map[string][]byte{ ...@@ -18,27 +19,27 @@ var coinPrefix = map[string][]byte{
var addrSeed = []byte("address seed bytes for public key") var addrSeed = []byte("address seed bytes for public key")
//MaxExecNameLength 执行器名最大长度 // MaxExecNameLength 执行器名最大长度
const MaxExecNameLength = 100 const MaxExecNameLength = 100
func PubKeyToAddress(pub []byte) (addr string, err error) { func PubKeyToAddress(pub []byte) (addr string, err error) {
if len(pub) != 33 && len(pub) != 65 { //压缩格式 与 非压缩格式 if len(pub) != 33 && len(pub) != 65 { // 压缩格式 与 非压缩格式
return "", fmt.Errorf("invalid public key byte") return "", fmt.Errorf("invalid public key byte")
} }
//添加版本号 // 添加版本号
hash160res := append(coinPrefix["BTY"], Rimp160(pub)...) hash160res := append(coinPrefix["BTY"], Rimp160(pub)...)
//添加校验码 // 添加校验码
cksum := checksum(hash160res) cksum := checksum(hash160res)
address := append(hash160res, cksum[:]...) address := append(hash160res, cksum[:]...)
//地址进行base58编码 // 地址进行base58编码
addr = base58.Encode(address) addr = base58.Encode(address)
return return
} }
//checksum: first four bytes of double-SHA256. // checksum: first four bytes of double-SHA256.
func checksum(input []byte) (cksum [4]byte) { func checksum(input []byte) (cksum [4]byte) {
h := sha256.New() h := sha256.New()
_, err := h.Write(input) _, err := h.Write(input)
...@@ -77,4 +78,4 @@ func GetExecAddress(name string) string { ...@@ -77,4 +78,4 @@ func GetExecAddress(name string) string {
addr := base58.Encode(ad[:]) addr := base58.Encode(ad[:])
return addr return addr
} }
\ No newline at end of file
...@@ -102,4 +102,4 @@ func AESCBCPKCS7Decrypt(key, src []byte) ([]byte, error) { ...@@ -102,4 +102,4 @@ func AESCBCPKCS7Decrypt(key, src []byte) ([]byte, error) {
func GenetateAESKey() []byte { func GenetateAESKey() []byte {
return getRandBytes(AESPrivateKeyLength) return getRandBytes(AESPrivateKeyLength)
} }
\ No newline at end of file
...@@ -3,13 +3,14 @@ package crypto ...@@ -3,13 +3,14 @@ package crypto
import ( import (
"bytes" "bytes"
"crypto/rand" "crypto/rand"
secp256k1 "github.com/btcsuite/btcd/btcec" secp256k1 "github.com/btcsuite/btcd/btcec"
) )
var ( var (
SECP256K1 = "secp256k1" SECP256K1 = "secp256k1"
SM2 = "sm2" SM2 = "sm2"
ED25519 = "ed25519" //TODO ED25519 = "ed25519" // TODO
) )
func GeneratePrivateKey() []byte { func GeneratePrivateKey() []byte {
...@@ -61,4 +62,4 @@ func getRandBytes(numBytes int) []byte { ...@@ -61,4 +62,4 @@ func getRandBytes(numBytes int) []byte {
panic("Panic on a Crisis" + err.Error()) panic("Panic on a Crisis" + err.Error())
} }
return b return b
} }
\ No newline at end of file
package crypto package crypto
import "github.com/33cn/chain33-sdk-go/types" import "gitlab.33.cn/link33/chain33-sdk-go/types"
func EncodeCertToSignature(signBytes, cert, uid []byte) []byte { func EncodeCertToSignature(signBytes, cert, uid []byte) []byte {
var certSignature types.CertSignature var certSignature types.CertSignature
......
package crypto package crypto
import ( import (
"fmt" "fmt"
"github.com/33cn/chain33-sdk-go/crypto/ed25519"
"github.com/33cn/chain33-sdk-go/crypto/gm"
"github.com/33cn/chain33-sdk-go/types"
"github.com/stretchr/testify/assert"
"testing" "testing"
"github.com/stretchr/testify/assert"
"gitlab.33.cn/link33/chain33-sdk-go/crypto/ed25519"
"gitlab.33.cn/link33/chain33-sdk-go/crypto/gm"
"gitlab.33.cn/link33/chain33-sdk-go/types"
) )
func TestAES(t *testing.T) { func TestAES(t *testing.T) {
var text = "hello aes" text := "hello aes"
var key = getRandBytes(16) key := getRandBytes(16)
cipherText, err := AESCBCPKCS7Encrypt(key, []byte(text)) cipherText, err := AESCBCPKCS7Encrypt(key, []byte(text))
if err != nil { if err != nil {
...@@ -35,7 +36,6 @@ func TestSign(t *testing.T) { ...@@ -35,7 +36,6 @@ func TestSign(t *testing.T) {
sig := Sign(msg, priv) sig := Sign(msg, priv)
fmt.Printf("sig = %x\n", sig) fmt.Printf("sig = %x\n", sig)
} }
func TestSM2(t *testing.T) { func TestSM2(t *testing.T) {
...@@ -48,7 +48,7 @@ func TestSM2(t *testing.T) { ...@@ -48,7 +48,7 @@ func TestSM2(t *testing.T) {
msg := []byte("sign test") msg := []byte("sign test")
sig, _ := gm.SM2Sign(msg, priv,nil) sig, _ := gm.SM2Sign(msg, priv, nil)
fmt.Printf("sig = %x\n", sig) fmt.Printf("sig = %x\n", sig)
result := gm.SM2Verify(pub, msg, nil, sig) result := gm.SM2Verify(pub, msg, nil, sig)
......
...@@ -17,10 +17,11 @@ import ( ...@@ -17,10 +17,11 @@ import (
"crypto/rand" "crypto/rand"
"crypto/sha512" "crypto/sha512"
"crypto/subtle" "crypto/subtle"
"github.com/33cn/chain33-sdk-go/crypto/ed25519/edwards25519"
"gitlab.33.cn/link33/chain33-sdk-go/crypto/ed25519/edwards25519"
) )
//const // const
const ( const (
PublicKeySize = 32 PublicKeySize = 32
PrivateKeySize = 64 PrivateKeySize = 64
......
...@@ -16,12 +16,12 @@ var d2 = FieldElement{ ...@@ -16,12 +16,12 @@ var d2 = FieldElement{
-21827239, -5839606, -30745221, 13898782, 229458, 15978800, -12551817, -6495438, 29715968, 9444199, -21827239, -5839606, -30745221, 13898782, 229458, 15978800, -12551817, -6495438, 29715968, 9444199,
} }
//SqrtM1 ... // SqrtM1 ...
var SqrtM1 = FieldElement{ var SqrtM1 = FieldElement{
-32595792, -7943725, 9377950, 3500415, 12389472, -272473, -25146209, -2005654, 326686, 11406482, -32595792, -7943725, 9377950, 3500415, 12389472, -272473, -25146209, -2005654, 326686, 11406482,
} }
//A ... // A ...
var A = FieldElement{ var A = FieldElement{
486662, 0, 0, 0, 0, 0, 0, 0, 0, 0, 486662, 0, 0, 0, 0, 0, 0, 0, 0, 0,
} }
......
...@@ -22,18 +22,18 @@ type FieldElement [10]int32 ...@@ -22,18 +22,18 @@ type FieldElement [10]int32
var zero FieldElement var zero FieldElement
//FeZero 0 // FeZero 0
func FeZero(fe *FieldElement) { func FeZero(fe *FieldElement) {
copy(fe[:], zero[:]) copy(fe[:], zero[:])
} }
//FeOne 1 // FeOne 1
func FeOne(fe *FieldElement) { func FeOne(fe *FieldElement) {
FeZero(fe) FeZero(fe)
fe[0] = 1 fe[0] = 1
} }
//FeAdd + // FeAdd +
func FeAdd(dst, a, b *FieldElement) { func FeAdd(dst, a, b *FieldElement) {
dst[0] = a[0] + b[0] dst[0] = a[0] + b[0]
dst[1] = a[1] + b[1] dst[1] = a[1] + b[1]
...@@ -47,7 +47,7 @@ func FeAdd(dst, a, b *FieldElement) { ...@@ -47,7 +47,7 @@ func FeAdd(dst, a, b *FieldElement) {
dst[9] = a[9] + b[9] dst[9] = a[9] + b[9]
} }
//FeSub - // FeSub -
func FeSub(dst, a, b *FieldElement) { func FeSub(dst, a, b *FieldElement) {
dst[0] = a[0] - b[0] dst[0] = a[0] - b[0]
dst[1] = a[1] - b[1] dst[1] = a[1] - b[1]
...@@ -61,7 +61,7 @@ func FeSub(dst, a, b *FieldElement) { ...@@ -61,7 +61,7 @@ func FeSub(dst, a, b *FieldElement) {
dst[9] = a[9] - b[9] dst[9] = a[9] - b[9]
} }
//FeCopy 复制 // FeCopy 复制
func FeCopy(dst, src *FieldElement) { func FeCopy(dst, src *FieldElement) {
copy(dst[:], src[:]) copy(dst[:], src[:])
} }
...@@ -99,7 +99,7 @@ func load4(in []byte) int64 { ...@@ -99,7 +99,7 @@ func load4(in []byte) int64 {
return r return r
} }
//FeFromBytes ... // FeFromBytes ...
func FeFromBytes(dst *FieldElement, src *[32]byte) { func FeFromBytes(dst *FieldElement, src *[32]byte) {
h0 := load4(src[:]) h0 := load4(src[:])
h1 := load3(src[4:]) << 6 h1 := load3(src[4:]) << 6
...@@ -227,14 +227,14 @@ func FeToBytes(s *[32]byte, h *FieldElement) { ...@@ -227,14 +227,14 @@ func FeToBytes(s *[32]byte, h *FieldElement) {
s[31] = byte(h[9] >> 18) s[31] = byte(h[9] >> 18)
} }
//FeIsNegative 是否为负 // FeIsNegative 是否为负
func FeIsNegative(f *FieldElement) byte { func FeIsNegative(f *FieldElement) byte {
var s [32]byte var s [32]byte
FeToBytes(&s, f) FeToBytes(&s, f)
return s[0] & 1 return s[0] & 1
} }
//FeIsNonZero 是否为非0 // FeIsNonZero 是否为非0
func FeIsNonZero(f *FieldElement) int32 { func FeIsNonZero(f *FieldElement) int32 {
var s [32]byte var s [32]byte
FeToBytes(&s, f) FeToBytes(&s, f)
...@@ -266,7 +266,7 @@ func FeNeg(h, f *FieldElement) { ...@@ -266,7 +266,7 @@ func FeNeg(h, f *FieldElement) {
h[9] = -f[9] h[9] = -f[9]
} }
//FeCombine 拼接 // FeCombine 拼接
func FeCombine(h *FieldElement, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9 int64) { func FeCombine(h *FieldElement, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9 int64) {
var c0, c1, c2, c3, c4, c5, c6, c7, c8, c9 int64 var c0, c1, c2, c3, c4, c5, c6, c7, c8, c9 int64
...@@ -514,7 +514,7 @@ func FeSquare2(h, f *FieldElement) { ...@@ -514,7 +514,7 @@ func FeSquare2(h, f *FieldElement) {
FeCombine(h, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9) FeCombine(h, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9)
} }
//FeInvert 反转 // FeInvert 反转
func FeInvert(out, z *FieldElement) { func FeInvert(out, z *FieldElement) {
var t0, t1, t2, t3 FieldElement var t0, t1, t2, t3 FieldElement
var i int var i int
...@@ -640,39 +640,39 @@ func fePow22523(out, z *FieldElement) { ...@@ -640,39 +640,39 @@ func fePow22523(out, z *FieldElement) {
// CompletedGroupElement: ((X:Z),(Y:T)) satisfying x=X/Z, y=Y/T // CompletedGroupElement: ((X:Z),(Y:T)) satisfying x=X/Z, y=Y/T
// PreComputedGroupElement: (y+x,y-x,2dxy) // PreComputedGroupElement: (y+x,y-x,2dxy)
//ProjectiveGroupElement (X:Y:Z) satisfying x=X/Z, y=Y/Z // ProjectiveGroupElement (X:Y:Z) satisfying x=X/Z, y=Y/Z
type ProjectiveGroupElement struct { type ProjectiveGroupElement struct {
X, Y, Z FieldElement X, Y, Z FieldElement
} }
//ExtendedGroupElement (X:Y:Z:T) satisfying x=X/Z, y=Y/Z, XY=ZT // ExtendedGroupElement (X:Y:Z:T) satisfying x=X/Z, y=Y/Z, XY=ZT
type ExtendedGroupElement struct { type ExtendedGroupElement struct {
X, Y, Z, T FieldElement X, Y, Z, T FieldElement
} }
//CompletedGroupElement ((X:Z),(Y:T)) satisfying x=X/Z, y=Y/T // CompletedGroupElement ((X:Z),(Y:T)) satisfying x=X/Z, y=Y/T
type CompletedGroupElement struct { type CompletedGroupElement struct {
X, Y, Z, T FieldElement X, Y, Z, T FieldElement
} }
//PreComputedGroupElement (y+x,y-x,2dxy) // PreComputedGroupElement (y+x,y-x,2dxy)
type PreComputedGroupElement struct { type PreComputedGroupElement struct {
yPlusX, yMinusX, xy2d FieldElement yPlusX, yMinusX, xy2d FieldElement
} }
//CachedGroupElement 缓存 // CachedGroupElement 缓存
type CachedGroupElement struct { type CachedGroupElement struct {
yPlusX, yMinusX, Z, T2d FieldElement yPlusX, yMinusX, Z, T2d FieldElement
} }
//Zero 0 // Zero 0
func (p *ProjectiveGroupElement) Zero() { func (p *ProjectiveGroupElement) Zero() {
FeZero(&p.X) FeZero(&p.X)
FeOne(&p.Y) FeOne(&p.Y)
FeOne(&p.Z) FeOne(&p.Z)
} }
//Double x2 // Double x2
func (p *ProjectiveGroupElement) Double(r *CompletedGroupElement) { func (p *ProjectiveGroupElement) Double(r *CompletedGroupElement) {
var t0 FieldElement var t0 FieldElement
...@@ -687,7 +687,7 @@ func (p *ProjectiveGroupElement) Double(r *CompletedGroupElement) { ...@@ -687,7 +687,7 @@ func (p *ProjectiveGroupElement) Double(r *CompletedGroupElement) {
FeSub(&r.T, &r.T, &r.Z) FeSub(&r.T, &r.T, &r.Z)
} }
//ToBytes ... // ToBytes ...
func (p *ProjectiveGroupElement) ToBytes(s *[32]byte) { func (p *ProjectiveGroupElement) ToBytes(s *[32]byte) {
var recip, x, y FieldElement var recip, x, y FieldElement
...@@ -698,7 +698,7 @@ func (p *ProjectiveGroupElement) ToBytes(s *[32]byte) { ...@@ -698,7 +698,7 @@ func (p *ProjectiveGroupElement) ToBytes(s *[32]byte) {
s[31] ^= FeIsNegative(&x) << 7 s[31] ^= FeIsNegative(&x) << 7
} }
//Zero 0 // Zero 0
func (p *ExtendedGroupElement) Zero() { func (p *ExtendedGroupElement) Zero() {
FeZero(&p.X) FeZero(&p.X)
FeOne(&p.Y) FeOne(&p.Y)
...@@ -706,14 +706,14 @@ func (p *ExtendedGroupElement) Zero() { ...@@ -706,14 +706,14 @@ func (p *ExtendedGroupElement) Zero() {
FeZero(&p.T) FeZero(&p.T)
} }
//Double x2 // Double x2
func (p *ExtendedGroupElement) Double(r *CompletedGroupElement) { func (p *ExtendedGroupElement) Double(r *CompletedGroupElement) {
var q ProjectiveGroupElement var q ProjectiveGroupElement
p.ToProjective(&q) p.ToProjective(&q)
q.Double(r) q.Double(r)
} }
//ToCached 缓存 // ToCached 缓存
func (p *ExtendedGroupElement) ToCached(r *CachedGroupElement) { func (p *ExtendedGroupElement) ToCached(r *CachedGroupElement) {
FeAdd(&r.yPlusX, &p.Y, &p.X) FeAdd(&r.yPlusX, &p.Y, &p.X)
FeSub(&r.yMinusX, &p.Y, &p.X) FeSub(&r.yMinusX, &p.Y, &p.X)
...@@ -721,14 +721,14 @@ func (p *ExtendedGroupElement) ToCached(r *CachedGroupElement) { ...@@ -721,14 +721,14 @@ func (p *ExtendedGroupElement) ToCached(r *CachedGroupElement) {
FeMul(&r.T2d, &p.T, &d2) FeMul(&r.T2d, &p.T, &d2)
} }
//ToProjective ... // ToProjective ...
func (p *ExtendedGroupElement) ToProjective(r *ProjectiveGroupElement) { func (p *ExtendedGroupElement) ToProjective(r *ProjectiveGroupElement) {
FeCopy(&r.X, &p.X) FeCopy(&r.X, &p.X)
FeCopy(&r.Y, &p.Y) FeCopy(&r.Y, &p.Y)
FeCopy(&r.Z, &p.Z) FeCopy(&r.Z, &p.Z)
} }
//ToBytes 字节化 // ToBytes 字节化
func (p *ExtendedGroupElement) ToBytes(s *[32]byte) { func (p *ExtendedGroupElement) ToBytes(s *[32]byte) {
var recip, x, y FieldElement var recip, x, y FieldElement
...@@ -739,7 +739,7 @@ func (p *ExtendedGroupElement) ToBytes(s *[32]byte) { ...@@ -739,7 +739,7 @@ func (p *ExtendedGroupElement) ToBytes(s *[32]byte) {
s[31] ^= FeIsNegative(&x) << 7 s[31] ^= FeIsNegative(&x) << 7
} }
//FromBytes ... // FromBytes ...
func (p *ExtendedGroupElement) FromBytes(s *[32]byte) bool { func (p *ExtendedGroupElement) FromBytes(s *[32]byte) bool {
var u, v, v3, vxx, check FieldElement var u, v, v3, vxx, check FieldElement
...@@ -786,14 +786,14 @@ func (p *ExtendedGroupElement) FromBytes(s *[32]byte) bool { ...@@ -786,14 +786,14 @@ func (p *ExtendedGroupElement) FromBytes(s *[32]byte) bool {
return true return true
} }
//ToProjective ... // ToProjective ...
func (p *CompletedGroupElement) ToProjective(r *ProjectiveGroupElement) { func (p *CompletedGroupElement) ToProjective(r *ProjectiveGroupElement) {
FeMul(&r.X, &p.X, &p.T) FeMul(&r.X, &p.X, &p.T)
FeMul(&r.Y, &p.Y, &p.Z) FeMul(&r.Y, &p.Y, &p.Z)
FeMul(&r.Z, &p.Z, &p.T) FeMul(&r.Z, &p.Z, &p.T)
} }
//ToExtended 扩展 // ToExtended 扩展
func (p *CompletedGroupElement) ToExtended(r *ExtendedGroupElement) { func (p *CompletedGroupElement) ToExtended(r *ExtendedGroupElement) {
FeMul(&r.X, &p.X, &p.T) FeMul(&r.X, &p.X, &p.T)
FeMul(&r.Y, &p.Y, &p.Z) FeMul(&r.Y, &p.Y, &p.Z)
...@@ -801,14 +801,14 @@ func (p *CompletedGroupElement) ToExtended(r *ExtendedGroupElement) { ...@@ -801,14 +801,14 @@ func (p *CompletedGroupElement) ToExtended(r *ExtendedGroupElement) {
FeMul(&r.T, &p.X, &p.Y) FeMul(&r.T, &p.X, &p.Y)
} }
//Zero 0 // Zero 0
func (p *PreComputedGroupElement) Zero() { func (p *PreComputedGroupElement) Zero() {
FeOne(&p.yPlusX) FeOne(&p.yPlusX)
FeOne(&p.yMinusX) FeOne(&p.yMinusX)
FeZero(&p.xy2d) FeZero(&p.xy2d)
} }
//GeAdd + // GeAdd +
func GeAdd(r *CompletedGroupElement, p *ExtendedGroupElement, q *CachedGroupElement) { func GeAdd(r *CompletedGroupElement, p *ExtendedGroupElement, q *CachedGroupElement) {
geAdd(r, p, q) geAdd(r, p, q)
} }
...@@ -972,7 +972,7 @@ func negative(b int32) int32 { ...@@ -972,7 +972,7 @@ func negative(b int32) int32 {
return (b >> 31) & 1 return (b >> 31) & 1
} }
//PreComputedGroupElementCMove ... // PreComputedGroupElementCMove ...
func PreComputedGroupElementCMove(t, u *PreComputedGroupElement, b int32) { func PreComputedGroupElementCMove(t, u *PreComputedGroupElement, b int32) {
FeCMove(&t.yPlusX, &u.yPlusX, b) FeCMove(&t.yPlusX, &u.yPlusX, b)
FeCMove(&t.yMinusX, &u.yMinusX, b) FeCMove(&t.yMinusX, &u.yMinusX, b)
...@@ -1479,7 +1479,7 @@ func ScMulAdd(s, a, b, c *[32]byte) { ...@@ -1479,7 +1479,7 @@ func ScMulAdd(s, a, b, c *[32]byte) {
s[31] = byte(s11 >> 17) s[31] = byte(s11 >> 17)
} }
//ScMulSub The scalars are GF(2^252 + 27742317777372353535851937790883648493). // ScMulSub The scalars are GF(2^252 + 27742317777372353535851937790883648493).
// Input: // Input:
// a[0]+256*a[1]+...+256^31*a[31] = a // a[0]+256*a[1]+...+256^31*a[31] = a
// b[0]+256*b[1]+...+256^31*b[31] = b // b[0]+256*b[1]+...+256^31*b[31] = b
...@@ -1912,7 +1912,7 @@ func ScMulSub(s, a, b, c *[32]byte) { ...@@ -1912,7 +1912,7 @@ func ScMulSub(s, a, b, c *[32]byte) {
s[31] = byte(s11 >> 17) s[31] = byte(s11 >> 17)
} }
//ScReduce Input: // ScReduce Input:
// s[0]+256*s[1]+...+256^63*s[63] = s // s[0]+256*s[1]+...+256^63*s[63] = s
// ProtoToJson: // ProtoToJson:
// s[0]+256*s[1]+...+256^31*s[31] = s mod l // s[0]+256*s[1]+...+256^31*s[31] = s mod l
...@@ -2235,7 +2235,7 @@ func ScReduce(out *[32]byte, s *[64]byte) { ...@@ -2235,7 +2235,7 @@ func ScReduce(out *[32]byte, s *[64]byte) {
out[31] = byte(s11 >> 17) out[31] = byte(s11 >> 17)
} }
//ScAdd Input: // ScAdd Input:
// s[0]+256*s[1]+...+256^31*s[31] = a // s[0]+256*s[1]+...+256^31*s[31] = a
// s[0]+256*s[1]+...+256^31*s[31] = b // s[0]+256*s[1]+...+256^31*s[31] = b
// ProtoToJson: // ProtoToJson:
...@@ -2474,7 +2474,7 @@ func ScAdd(out *[32]byte, a, b *[32]byte) { ...@@ -2474,7 +2474,7 @@ func ScAdd(out *[32]byte, a, b *[32]byte) {
out[31] = byte((s11 >> 17)) out[31] = byte((s11 >> 17))
} }
//ScSub Input: // ScSub Input:
// s[0]+256*s[1]+...+256^31*s[31] = a // s[0]+256*s[1]+...+256^31*s[31] = a
// s[0]+256*s[1]+...+256^31*s[31] = b // s[0]+256*s[1]+...+256^31*s[31] = b
// ProtoToJson: // ProtoToJson:
...@@ -2717,7 +2717,7 @@ func signum(a int64) int64 { ...@@ -2717,7 +2717,7 @@ func signum(a int64) int64 {
return (a >> 63) - ((-a) >> 63) return (a >> 63) - ((-a) >> 63)
} }
//ScCheck 检查 // ScCheck 检查
func ScCheck(s *[32]byte) bool { func ScCheck(s *[32]byte) bool {
s0 := load4(s[:]) s0 := load4(s[:])
s1 := load4(s[4:]) s1 := load4(s[4:])
......
...@@ -8,7 +8,7 @@ Package edwards25519 将edwards25519中的差异代码移动到本处进行差 ...@@ -8,7 +8,7 @@ Package edwards25519 将edwards25519中的差异代码移动到本处进行差
package edwards25519 package edwards25519
import ( import (
"github.com/33cn/chain33-sdk-go/crypto/sha3" "gitlab.33.cn/link33/chain33-sdk-go/crypto/sha3"
) )
var ( var (
...@@ -26,10 +26,10 @@ var ( ...@@ -26,10 +26,10 @@ var (
feFFFB4 = FieldElement{-21786234, -12173074, 21573800, 4524538, -4645904, 16204591, 8012863, -8444712, 3212926, 6885324} feFFFB4 = FieldElement{-21786234, -12173074, 21573800, 4524538, -4645904, 16204591, 8012863, -8444712, 3212926, 6885324}
) )
//DsmPreCompGroupElement ... // DsmPreCompGroupElement ...
type DsmPreCompGroupElement [8]CachedGroupElement type DsmPreCompGroupElement [8]CachedGroupElement
//FromCompletedGroupElement ... // FromCompletedGroupElement ...
func (e *ExtendedGroupElement) FromCompletedGroupElement(p *CompletedGroupElement) { func (e *ExtendedGroupElement) FromCompletedGroupElement(p *CompletedGroupElement) {
FeMul(&e.X, &p.X, &p.T) FeMul(&e.X, &p.X, &p.T)
FeMul(&e.Y, &p.Y, &p.Z) FeMul(&e.Y, &p.Y, &p.Z)
...@@ -37,7 +37,7 @@ func (e *ExtendedGroupElement) FromCompletedGroupElement(p *CompletedGroupElemen ...@@ -37,7 +37,7 @@ func (e *ExtendedGroupElement) FromCompletedGroupElement(p *CompletedGroupElemen
FeMul(&e.T, &p.X, &p.Y) FeMul(&e.T, &p.X, &p.Y)
} }
//Zero 0 // Zero 0
func (c *CachedGroupElement) Zero() { func (c *CachedGroupElement) Zero() {
FeOne(&c.yPlusX) FeOne(&c.yPlusX)
FeOne(&c.yMinusX) FeOne(&c.yMinusX)
...@@ -45,7 +45,7 @@ func (c *CachedGroupElement) Zero() { ...@@ -45,7 +45,7 @@ func (c *CachedGroupElement) Zero() {
FeZero(&c.T2d) FeZero(&c.T2d)
} }
//FeToBytesV1 ... // FeToBytesV1 ...
func FeToBytesV1(s *[32]byte, h *FieldElement) { func FeToBytesV1(s *[32]byte, h *FieldElement) {
var q int32 var q int32
h0 := h[0] h0 := h[0]
...@@ -137,14 +137,14 @@ func FeToBytesV1(s *[32]byte, h *FieldElement) { ...@@ -137,14 +137,14 @@ func FeToBytesV1(s *[32]byte, h *FieldElement) {
s[31] = byte(h9 >> 18) s[31] = byte(h9 >> 18)
} }
//FeIsNegativeV1 是否为负 // FeIsNegativeV1 是否为负
func FeIsNegativeV1(f *FieldElement) byte { func FeIsNegativeV1(f *FieldElement) byte {
var s [32]byte var s [32]byte
FeToBytesV1(&s, f) FeToBytesV1(&s, f)
return s[0] & 1 return s[0] & 1
} }
//FeIsNonZeroV1 是否非0 // FeIsNonZeroV1 是否非0
func FeIsNonZeroV1(f *FieldElement) int32 { func FeIsNonZeroV1(f *FieldElement) int32 {
var s [32]byte var s [32]byte
FeToBytesV1(&s, f) FeToBytesV1(&s, f)
...@@ -158,7 +158,7 @@ func FeIsNonZeroV1(f *FieldElement) int32 { ...@@ -158,7 +158,7 @@ func FeIsNonZeroV1(f *FieldElement) int32 {
return int32(x & 1) return int32(x & 1)
} }
//GeDoubleScalarmultPrecompVartime ... // GeDoubleScalarmultPrecompVartime ...
func GeDoubleScalarmultPrecompVartime(r *ProjectiveGroupElement, a *[32]byte, A *ExtendedGroupElement, b *[32]byte, Bi *DsmPreCompGroupElement) { func GeDoubleScalarmultPrecompVartime(r *ProjectiveGroupElement, a *[32]byte, A *ExtendedGroupElement, b *[32]byte, Bi *DsmPreCompGroupElement) {
var aslide, bslide [256]int8 var aslide, bslide [256]int8
var Ai DsmPreCompGroupElement // A,3A,5A,7A,9A,11A,13A,15A var Ai DsmPreCompGroupElement // A,3A,5A,7A,9A,11A,13A,15A
...@@ -223,7 +223,7 @@ func checkFieldElement(x, y, w *FieldElement, r *ProjectiveGroupElement) int { ...@@ -223,7 +223,7 @@ func checkFieldElement(x, y, w *FieldElement, r *ProjectiveGroupElement) int {
return 0 return 0
} }
//FeDivPowm1 ... // FeDivPowm1 ...
func FeDivPowm1(r, u, v *FieldElement) { func FeDivPowm1(r, u, v *FieldElement) {
var v3, uv7, t0, t1, t2 FieldElement var v3, uv7, t0, t1, t2 FieldElement
var i int var i int
...@@ -335,7 +335,7 @@ func geFromfeFrombytesVartime(r *ProjectiveGroupElement, s *[32]byte) { ...@@ -335,7 +335,7 @@ func geFromfeFrombytesVartime(r *ProjectiveGroupElement, s *[32]byte) {
FeMul(&r.X, &r.X, &r.Z) FeMul(&r.X, &r.X, &r.Z)
} }
//HashToEc ... // HashToEc ...
func HashToEc(key []byte, res *ExtendedGroupElement) { func HashToEc(key []byte, res *ExtendedGroupElement) {
var point ProjectiveGroupElement var point ProjectiveGroupElement
var point2 CompletedGroupElement var point2 CompletedGroupElement
...@@ -345,7 +345,7 @@ func HashToEc(key []byte, res *ExtendedGroupElement) { ...@@ -345,7 +345,7 @@ func HashToEc(key []byte, res *ExtendedGroupElement) {
point2.ToExtended(res) point2.ToExtended(res)
} }
//CachedGroupElementCMove ... // CachedGroupElementCMove ...
func CachedGroupElementCMove(t, u *CachedGroupElement, b int32) { func CachedGroupElementCMove(t, u *CachedGroupElement, b int32) {
FeCMove(&t.yPlusX, &u.yPlusX, b) FeCMove(&t.yPlusX, &u.yPlusX, b)
FeCMove(&t.yMinusX, &u.yMinusX, b) FeCMove(&t.yMinusX, &u.yMinusX, b)
...@@ -359,7 +359,7 @@ func negative8(b int8) byte { ...@@ -359,7 +359,7 @@ func negative8(b int8) byte {
return byte(x) return byte(x)
} }
//GeScalarMult Preconditions: // GeScalarMult Preconditions:
// a[31] <= 127 // a[31] <= 127
func GeScalarMult(r *ProjectiveGroupElement, a *[32]byte, A *ExtendedGroupElement) { func GeScalarMult(r *ProjectiveGroupElement, a *[32]byte, A *ExtendedGroupElement) {
var e [64]int8 var e [64]int8
...@@ -416,7 +416,7 @@ func GeScalarMult(r *ProjectiveGroupElement, a *[32]byte, A *ExtendedGroupElemen ...@@ -416,7 +416,7 @@ func GeScalarMult(r *ProjectiveGroupElement, a *[32]byte, A *ExtendedGroupElemen
} }
} }
//ScIsNonZero ... // ScIsNonZero ...
func ScIsNonZero(s *[32]byte) int32 { func ScIsNonZero(s *[32]byte) int32 {
var x uint8 var x uint8
for _, b := range s { for _, b := range s {
...@@ -428,7 +428,7 @@ func ScIsNonZero(s *[32]byte) int32 { ...@@ -428,7 +428,7 @@ func ScIsNonZero(s *[32]byte) int32 {
return int32(x & 1) return int32(x & 1)
} }
//GeFromBytesVartime ... // GeFromBytesVartime ...
func GeFromBytesVartime(p *ExtendedGroupElement, s *[32]byte) bool { func GeFromBytesVartime(p *ExtendedGroupElement, s *[32]byte) bool {
var u, v, vxx, check FieldElement var u, v, vxx, check FieldElement
...@@ -520,7 +520,7 @@ func GeFromBytesVartime(p *ExtendedGroupElement, s *[32]byte) bool { ...@@ -520,7 +520,7 @@ func GeFromBytesVartime(p *ExtendedGroupElement, s *[32]byte) bool {
return true return true
} }
//GeDsmPrecomp ... // GeDsmPrecomp ...
func GeDsmPrecomp(r *DsmPreCompGroupElement, s *ExtendedGroupElement) { func GeDsmPrecomp(r *DsmPreCompGroupElement, s *ExtendedGroupElement) {
var t CompletedGroupElement var t CompletedGroupElement
var s2, u ExtendedGroupElement var s2, u ExtendedGroupElement
......
...@@ -5,16 +5,17 @@ import ( ...@@ -5,16 +5,17 @@ import (
"crypto/elliptic" "crypto/elliptic"
"crypto/rand" "crypto/rand"
"fmt" "fmt"
"math/big"
"github.com/btcsuite/btcd/btcec" "github.com/btcsuite/btcd/btcec"
"github.com/tjfoc/gmsm/sm2" "github.com/tjfoc/gmsm/sm2"
"math/big"
) )
const ( const (
SM2PrivateKeyLength = 32 SM2PrivateKeyLength = 32
) )
var DefaultUID = []byte{0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38} var DefaultUID = []byte{0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38}
func getRandBytes(numBytes int) []byte { func getRandBytes(numBytes int) []byte {
b := make([]byte, numBytes) b := make([]byte, numBytes)
...@@ -44,12 +45,12 @@ func parsePubKey(pubKeyStr []byte) (key *sm2.PublicKey) { ...@@ -44,12 +45,12 @@ func parsePubKey(pubKeyStr []byte) (key *sm2.PublicKey) {
return sm2.Decompress(pubKeyStr) return sm2.Decompress(pubKeyStr)
} }
//SerializePublicKey 公钥序列化 // SerializePublicKey 公钥序列化
func SerializePublicKey(p *sm2.PublicKey) []byte { func SerializePublicKey(p *sm2.PublicKey) []byte {
return sm2.Compress(p) return sm2.Compress(p)
} }
//SerializePrivateKey 私钥序列化 // SerializePrivateKey 私钥序列化
func SerializePrivateKey(p *sm2.PrivateKey) []byte { func SerializePrivateKey(p *sm2.PrivateKey) []byte {
b := make([]byte, 0, SM2PrivateKeyLength) b := make([]byte, 0, SM2PrivateKeyLength)
return paddedAppend(SM2PrivateKeyLength, b, p.D.Bytes()) return paddedAppend(SM2PrivateKeyLength, b, p.D.Bytes())
...@@ -141,7 +142,7 @@ func SM2Verify(publicKey []byte, msg []byte, uid []byte, sig []byte) bool { ...@@ -141,7 +142,7 @@ func SM2Verify(publicKey []byte, msg []byte, uid []byte, sig []byte) bool {
pub := parsePubKey(publicKey[:]) pub := parsePubKey(publicKey[:])
r, s, err := DeserializeSignature(sig) r, s, err := DeserializeSignature(sig)
if err != nil { if err != nil {
fmt.Errorf("unmarshal sign failed:"+err.Error()) fmt.Errorf("unmarshal sign failed:" + err.Error())
return false return false
} }
...@@ -163,4 +164,4 @@ func SM2Decrypt(privateKey []byte, data []byte) ([]byte, error) { ...@@ -163,4 +164,4 @@ func SM2Decrypt(privateKey []byte, data []byte) ([]byte, error) {
func PubKeyFromPrivate(privKey []byte) []byte { func PubKeyFromPrivate(privKey []byte) []byte {
_, pub := PrivKeyFromBytes(sm2.P256Sm2(), privKey) _, pub := PrivKeyFromBytes(sm2.P256Sm2(), privKey)
return SerializePublicKey(pub) return SerializePublicKey(pub)
} }
\ No newline at end of file
...@@ -2,7 +2,7 @@ package gm ...@@ -2,7 +2,7 @@ package gm
import "github.com/tjfoc/gmsm/sm3" import "github.com/tjfoc/gmsm/sm3"
//SM3Hash 加密算法 // SM3Hash 加密算法
func SM3Hash(msg []byte) []byte { func SM3Hash(msg []byte) []byte {
c := sm3.New() c := sm3.New()
c.Write(msg) c.Write(msg)
......
package gm package gm
import ( import (
"github.com/tjfoc/gmsm/sm4"
"log" "log"
"github.com/tjfoc/gmsm/sm4"
) )
const ( const (
...@@ -33,4 +34,4 @@ func SM4Decrypt(key []byte, data []byte) []byte { ...@@ -33,4 +34,4 @@ func SM4Decrypt(key []byte, data []byte) []byte {
c.Decrypt(cipher, data) c.Decrypt(cipher, data)
return cipher return cipher
} }
\ No newline at end of file
...@@ -3,10 +3,10 @@ package crypto ...@@ -3,10 +3,10 @@ package crypto
import ( import (
"crypto/sha256" "crypto/sha256"
"encoding/binary" "encoding/binary"
"golang.org/x/crypto/ripemd160" "golang.org/x/crypto/ripemd160"
) )
func Sha256(b []byte) []byte { func Sha256(b []byte) []byte {
hasher := sha256.New() hasher := sha256.New()
hasher.Write(b) hasher.Write(b)
...@@ -42,7 +42,7 @@ func Rimp160(b []byte) []byte { ...@@ -42,7 +42,7 @@ func Rimp160(b []byte) []byte {
} }
func intToBytes(x int) []byte { func intToBytes(x int) []byte {
var buf = make([]byte, 4) buf := make([]byte, 4)
binary.BigEndian.PutUint32(buf, uint32(x)) binary.BigEndian.PutUint32(buf, uint32(x))
return buf return buf
...@@ -51,7 +51,7 @@ func intToBytes(x int) []byte { ...@@ -51,7 +51,7 @@ func intToBytes(x int) []byte {
func KDF(x []byte, length int) []byte { func KDF(x []byte, length int) []byte {
var c []byte var c []byte
var ct = 1 ct := 1
h := sha256.New() h := sha256.New()
for i, j := 0, (length+31)/32; i < j; i++ { for i, j := 0, (length+31)/32; i < j; i++ {
h.Reset() h.Reset()
...@@ -67,4 +67,4 @@ func KDF(x []byte, length int) []byte { ...@@ -67,4 +67,4 @@ func KDF(x []byte, length int) []byte {
} }
return c return c
} }
\ No newline at end of file
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// +build !amd64 appengine gccgo //go:build !amd64 || appengine || gccgo
// +build !amd64 appengine gccgo
package sha3 package sha3
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
//go:build amd64 && !appengine && !gccgo
// +build amd64,!appengine,!gccgo // +build amd64,!appengine,!gccgo
package sha3 package sha3
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
//go:build go1.4
// +build go1.4 // +build go1.4
package sha3 package sha3
......
...@@ -37,6 +37,7 @@ const ( ...@@ -37,6 +37,7 @@ const (
func newHashShake128() hash.Hash { func newHashShake128() hash.Hash {
return &state{rate: 168, dsbyte: 0x1f, outputLen: 512} return &state{rate: 168, dsbyte: 0x1f, outputLen: 512}
} }
func newHashShake256() hash.Hash { func newHashShake256() hash.Hash {
return &state{rate: 136, dsbyte: 0x1f, outputLen: 512} return &state{rate: 136, dsbyte: 0x1f, outputLen: 512}
} }
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
//go:build (!amd64 && !386 && !ppc64le) || appengine
// +build !amd64,!386,!ppc64le appengine // +build !amd64,!386,!ppc64le appengine
package sha3 package sha3
...@@ -17,4 +18,4 @@ var ( ...@@ -17,4 +18,4 @@ var (
copyOutUnaligned = copyOutGeneric copyOutUnaligned = copyOutGeneric
) )
//const xorImplementationUnaligned = "generic" // const xorImplementationUnaligned = "generic"
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
//go:build (amd64 || 386 || ppc64le) && !appengine
// +build amd64 386 ppc64le // +build amd64 386 ppc64le
// +build !appengine // +build !appengine
...@@ -59,4 +60,4 @@ var ( ...@@ -59,4 +60,4 @@ var (
copyOut = copyOutUnaligned copyOut = copyOutUnaligned
) )
//const xorImplementationUnaligned = "unaligned" // const xorImplementationUnaligned = "unaligned"
package broker package broker
import ( import (
"github.com/33cn/chain33-sdk-go/crypto"
"github.com/33cn/chain33-sdk-go/types"
"math/rand" "math/rand"
"time" "time"
"gitlab.33.cn/link33/chain33-sdk-go/crypto"
"gitlab.33.cn/link33/chain33-sdk-go/types"
) )
//构造发布跨链交易事件交易 // 构造发布跨链交易事件交易
func EmitInterchainEvent(paraName,dstServiceID ,funcName string,args[]string,txType uint64)(*types.Transaction,error){ func EmitInterchainEvent(paraName, dstServiceID, funcName string, args []string, txType uint64) (*types.Transaction, error) {
//目的链ID,固定格式0x000001 //目的链ID,固定格式0x000001
//string dstServiceID = 2; //string dstServiceID = 2;
////源链ID,固定格式0x000002 ////源链ID,固定格式0x000002
...@@ -19,7 +20,7 @@ func EmitInterchainEvent(paraName,dstServiceID ,funcName string,args[]string,txT ...@@ -19,7 +20,7 @@ func EmitInterchainEvent(paraName,dstServiceID ,funcName string,args[]string,txT
//string func = 5; //string func = 5;
////参数列表 ////参数列表
//repeated string args = 6; //repeated string args = 6;
payload := &types.BrokerAction{Ty:TyEmitInterchainEventAction,Value:&types.BrokerAction_EmitInterchainEvent{EmitInterchainEvent:&types.InterchainEvent{DstServiceID:dstServiceID,Type:txType,Func:funcName,Args:args}}} payload := &types.BrokerAction{Ty: TyEmitInterchainEventAction, Value: &types.BrokerAction_EmitInterchainEvent{EmitInterchainEvent: &types.InterchainEvent{DstServiceID: dstServiceID, Type: txType, Func: funcName, Args: args}}}
if paraName == "" { if paraName == "" {
tx := &types.Transaction{Execer: []byte(BrokerX), Payload: types.Encode(payload), Fee: 1e5, Nonce: rand.Int63n(time.Now().UnixNano()), To: Addr} tx := &types.Transaction{Execer: []byte(BrokerX), Payload: types.Encode(payload), Fee: 1e5, Nonce: rand.Int63n(time.Now().UnixNano()), To: Addr}
return tx, nil return tx, nil
...@@ -29,8 +30,8 @@ func EmitInterchainEvent(paraName,dstServiceID ,funcName string,args[]string,txT ...@@ -29,8 +30,8 @@ func EmitInterchainEvent(paraName,dstServiceID ,funcName string,args[]string,txT
} }
} }
//构造更新Index交易 // 构造更新Index交易
func UpdateIndex(paraName,srcServiceID,dstServiceID string,sequenceNum,reqType uint64,response *types.Response)(*types.Transaction,error){ func UpdateIndex(paraName, srcServiceID, dstServiceID string, sequenceNum, reqType uint64, response *types.Response) (*types.Transaction, error) {
////当前链已经处理到的位置 ////当前链已经处理到的位置
//uint64 sequenceNum = 1; //uint64 sequenceNum = 1;
////目的链服务ID,固定格式0x000001 ////目的链服务ID,固定格式0x000001
...@@ -41,7 +42,7 @@ func UpdateIndex(paraName,srcServiceID,dstServiceID string,sequenceNum,reqType u ...@@ -41,7 +42,7 @@ func UpdateIndex(paraName,srcServiceID,dstServiceID string,sequenceNum,reqType u
//uint64 reqType =4; //uint64 reqType =4;
////响应信息 ////响应信息
//Response response = 5; //Response response = 5;
payload :=&types.BrokerAction{Ty:TyUpdateIndexAction,Value:&types.BrokerAction_UpdateIndex{UpdateIndex:&types.UpdateIndex{DstServiceID:dstServiceID,SrcServiceID:srcServiceID,ReqType:reqType,SequenceNum:sequenceNum,Response:response}}} payload := &types.BrokerAction{Ty: TyUpdateIndexAction, Value: &types.BrokerAction_UpdateIndex{UpdateIndex: &types.UpdateIndex{DstServiceID: dstServiceID, SrcServiceID: srcServiceID, ReqType: reqType, SequenceNum: sequenceNum, Response: response}}}
if paraName == "" { if paraName == "" {
tx := &types.Transaction{Execer: []byte(BrokerX), Payload: types.Encode(payload), Fee: 1e5, Nonce: rand.Int63n(time.Now().UnixNano()), To: Addr} tx := &types.Transaction{Execer: []byte(BrokerX), Payload: types.Encode(payload), Fee: 1e5, Nonce: rand.Int63n(time.Now().UnixNano()), To: Addr}
return tx, nil return tx, nil
...@@ -49,4 +50,4 @@ func UpdateIndex(paraName,srcServiceID,dstServiceID string,sequenceNum,reqType u ...@@ -49,4 +50,4 @@ func UpdateIndex(paraName,srcServiceID,dstServiceID string,sequenceNum,reqType u
tx := &types.Transaction{Execer: []byte(paraName + BrokerX), Payload: types.Encode(payload), Fee: 1e5, Nonce: rand.Int63n(time.Now().UnixNano()), To: crypto.GetExecAddress(paraName + BrokerX)} tx := &types.Transaction{Execer: []byte(paraName + BrokerX), Payload: types.Encode(payload), Fee: 1e5, Nonce: rand.Int63n(time.Now().UnixNano()), To: crypto.GetExecAddress(paraName + BrokerX)}
return tx, nil return tx, nil
} }
} }
\ No newline at end of file
...@@ -14,26 +14,25 @@ const ( ...@@ -14,26 +14,25 @@ const (
NameUpdateIndexAction = "UpdateIndex" NameUpdateIndexAction = "UpdateIndex"
NameEmitInterchainEventAction = "EmitInterchainEvent" NameEmitInterchainEventAction = "EmitInterchainEvent"
FuncNamePollingEvent = "PollingEvent" FuncNamePollingEvent = "PollingEvent"
FuncNameQueryInnerMeta = "QueryInnerMeta" FuncNameQueryInnerMeta = "QueryInnerMeta"
FuncNameQueryOutterMeta = "QueryOutterMeta" FuncNameQueryOutterMeta = "QueryOutterMeta"
FuncNameQueryCallBackMeta = "QueryCallBackMeta" FuncNameQueryCallBackMeta = "QueryCallBackMeta"
FuncNameQueryInMessage = "QueryInMessage" FuncNameQueryInMessage = "QueryInMessage"
FuncNameQueryOutMessage = "QueryOutMessage" FuncNameQueryOutMessage = "QueryOutMessage"
FuncNameQueryBrokerInfo = "GetBrokerInfo" FuncNameQueryBrokerInfo = "GetBrokerInfo"
) )
//BrokerX 执行器名称定义
// BrokerX 执行器名称定义
const BrokerX = "broker" const BrokerX = "broker"
const Addr = "1MCftFynyvG2F4ED5mdHYgziDxx6vDrScs" const Addr = "1MCftFynyvG2F4ED5mdHYgziDxx6vDrScs"
var ( // 定义actionMap
//定义actionMap var ActionMap = map[string]int32{
ActionMap = map[string]int32{ NameInitAction: TyInitAction,
NameInitAction: TyInitAction, NameRegisterAction: TyRegisterAction,
NameRegisterAction: TyRegisterAction, NameAuditAction: TyAuditAction,
NameAuditAction: TyAuditAction, NameUpdateIndexAction: TyUpdateIndexAction,
NameUpdateIndexAction: TyUpdateIndexAction, NameEmitInterchainEventAction: TyEmitInterchainEventAction,
NameEmitInterchainEventAction: TyEmitInterchainEventAction, }
}
)
package cert package cert
import ( import (
sdk "github.com/33cn/chain33-sdk-go"
"github.com/33cn/chain33-sdk-go/crypto"
"github.com/33cn/chain33-sdk-go/types"
"math/rand" "math/rand"
"time" "time"
sdk "gitlab.33.cn/link33/chain33-sdk-go"
"gitlab.33.cn/link33/chain33-sdk-go/crypto"
"gitlab.33.cn/link33/chain33-sdk-go/types"
) )
func CreateCertNormalTx(paraName string, privateKey []byte, cert []byte, uid []byte, key string, value []byte) (*types.Transaction, error) { func CreateCertNormalTx(paraName string, privateKey []byte, cert []byte, uid []byte, key string, value []byte) (*types.Transaction, error) {
...@@ -16,7 +17,7 @@ func CreateCertNormalTx(paraName string, privateKey []byte, cert []byte, uid []b ...@@ -16,7 +17,7 @@ func CreateCertNormalTx(paraName string, privateKey []byte, cert []byte, uid []b
Value: value, Value: value,
}, },
}, },
Ty: CertActionNormal, Ty: CertActionNormal,
} }
var tx *types.Transaction var tx *types.Transaction
...@@ -27,7 +28,7 @@ func CreateCertNormalTx(paraName string, privateKey []byte, cert []byte, uid []b ...@@ -27,7 +28,7 @@ func CreateCertNormalTx(paraName string, privateKey []byte, cert []byte, uid []b
} }
var err error var err error
tx,err = sdk.Sign(tx, privateKey, crypto.SM2, uid) tx, err = sdk.Sign(tx, privateKey, crypto.SM2, uid)
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
package cert package cert
import ( import (
sdk "github.com/33cn/chain33-sdk-go"
"github.com/33cn/chain33-sdk-go/client"
"github.com/33cn/chain33-sdk-go/crypto"
"github.com/33cn/chain33-sdk-go/types"
"github.com/stretchr/testify/assert"
"testing" "testing"
"time" "time"
"github.com/stretchr/testify/assert"
sdk "gitlab.33.cn/link33/chain33-sdk-go"
"gitlab.33.cn/link33/chain33-sdk-go/client"
"gitlab.33.cn/link33/chain33-sdk-go/crypto"
"gitlab.33.cn/link33/chain33-sdk-go/types"
) )
var ( var (
url = "http://127.0.0.1:8801" url = "http://127.0.0.1:8801"
keyFilePath = "./test/keystore/5c3682a5719cf5bc1bd6280938670c3acfcb67cc15744a7b9b348066795a4e62_sk" keyFilePath = "./test/keystore/5c3682a5719cf5bc1bd6280938670c3acfcb67cc15744a7b9b348066795a4e62_sk"
certFilePath = "./test/signcerts/user1@org1-cert.pem" certFilePath = "./test/signcerts/user1@org1-cert.pem"
) )
func TestCreateCertNormalTx(t *testing.T) { func TestCreateCertNormalTx(t *testing.T) {
account,err := sdk.NewAccountFromLocal(crypto.SM2, keyFilePath) account, err := sdk.NewAccountFromLocal(crypto.SM2, keyFilePath)
assert.Nil(t, err) assert.Nil(t, err)
certByte,err := types.ReadFile(certFilePath) certByte, err := types.ReadFile(certFilePath)
assert.Nil(t, err) assert.Nil(t, err)
tx, err := CreateCertNormalTx("", account.PrivateKey, certByte, []byte("cert test"), "key1", []byte("value1")) tx, err := CreateCertNormalTx("", account.PrivateKey, certByte, []byte("cert test"), "key1", []byte("value1"))
...@@ -40,5 +41,4 @@ func TestCreateCertNormalTx(t *testing.T) { ...@@ -40,5 +41,4 @@ func TestCreateCertNormalTx(t *testing.T) {
detail, err := jsonclient.QueryTransaction(txhash) detail, err := jsonclient.QueryTransaction(txhash)
assert.Nil(t, err) assert.Nil(t, err)
assert.Equal(t, types.ExecOk, int(detail.Receipt.Ty)) assert.Equal(t, types.ExecOk, int(detail.Receipt.Ty))
} }
...@@ -3,10 +3,11 @@ package dapp ...@@ -3,10 +3,11 @@ package dapp
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/33cn/chain33-sdk-go/client"
. "github.com/33cn/chain33-sdk-go/dapp/broker" "gitlab.33.cn/link33/chain33-sdk-go/client"
"github.com/33cn/chain33-sdk-go/dapp/storage" . "gitlab.33.cn/link33/chain33-sdk-go/dapp/broker"
"github.com/33cn/chain33-sdk-go/types" "gitlab.33.cn/link33/chain33-sdk-go/dapp/storage"
"gitlab.33.cn/link33/chain33-sdk-go/types"
. "github.com/bitly/go-simplejson" . "github.com/bitly/go-simplejson"
) )
...@@ -25,7 +26,7 @@ func QueryStorageByKey(prefix, url, key string) (*types.Storage, error) { ...@@ -25,7 +26,7 @@ func QueryStorageByKey(prefix, url, key string) (*types.Storage, error) {
FuncName: storage.FuncNameQueryStorage, FuncName: storage.FuncNameQueryStorage,
Payload: jsonraw, Payload: jsonraw,
} }
//var storage types.Storage // var storage types.Storage
data, err := jsonClient.CallBack("Chain33.Query", query, ParseStorage) data, err := jsonClient.CallBack("Chain33.Query", query, ParseStorage)
if err != nil { if err != nil {
return nil, err return nil, err
...@@ -33,7 +34,7 @@ func QueryStorageByKey(prefix, url, key string) (*types.Storage, error) { ...@@ -33,7 +34,7 @@ func QueryStorageByKey(prefix, url, key string) (*types.Storage, error) {
return data.(*types.Storage), nil return data.(*types.Storage), nil
} }
//回调解析函数 // 回调解析函数
func ParseStorage(raw json.RawMessage) (interface{}, error) { func ParseStorage(raw json.RawMessage) (interface{}, error) {
js, err := NewJson(raw) js, err := NewJson(raw)
if err != nil { if err != nil {
......
...@@ -2,10 +2,11 @@ package storage ...@@ -2,10 +2,11 @@ package storage
import ( import (
"fmt" "fmt"
"github.com/33cn/chain33-sdk-go/crypto"
. "github.com/33cn/chain33-sdk-go/types"
"math/rand" "math/rand"
"time" "time"
"gitlab.33.cn/link33/chain33-sdk-go/crypto"
. "gitlab.33.cn/link33/chain33-sdk-go/types"
) )
/* /*
...@@ -25,15 +26,16 @@ func CreateContentStorageTx(paraName string, op int32, key string, content []byt ...@@ -25,15 +26,16 @@ func CreateContentStorageTx(paraName string, op int32, key string, content []byt
if op != 0 && op != 1 { if op != 0 && op != 1 {
return nil, fmt.Errorf("unknow op..,op only 0 or 1,please check!") return nil, fmt.Errorf("unknow op..,op only 0 or 1,please check!")
} }
payload := &StorageAction{Ty: TyContentStorageAction, Value: &StorageAction_ContentStorage{&ContentOnlyNotaryStorage{ payload := &StorageAction{
Content: content, Ty: TyContentStorageAction, Value: &StorageAction_ContentStorage{&ContentOnlyNotaryStorage{
Op: op, Content: content,
Key: key, Op: op,
Value: value, Key: key,
XXX_NoUnkeyedLiteral: struct{}{}, Value: value,
XXX_unrecognized: nil, XXX_NoUnkeyedLiteral: struct{}{},
XXX_sizecache: 0, XXX_unrecognized: nil,
}}, XXX_sizecache: 0,
}},
} }
if paraName == "" { if paraName == "" {
tx := &Transaction{Execer: []byte(StorageX), Payload: Encode(payload), Fee: 1e5, Nonce: rand.Int63n(time.Now().UnixNano()), To: Addr} tx := &Transaction{Execer: []byte(StorageX), Payload: Encode(payload), Fee: 1e5, Nonce: rand.Int63n(time.Now().UnixNano()), To: Addr}
...@@ -44,16 +46,17 @@ func CreateContentStorageTx(paraName string, op int32, key string, content []byt ...@@ -44,16 +46,17 @@ func CreateContentStorageTx(paraName string, op int32, key string, content []byt
} }
} }
//链接存证 paraName 平行链前缀,如果是主链则为空字符串,key唯一性,如果不填默认采用txhash为key // 链接存证 paraName 平行链前缀,如果是主链则为空字符串,key唯一性,如果不填默认采用txhash为key
func CreateLinkStorageTx(paraName string, key string, link []byte, value string) (*Transaction, error) { func CreateLinkStorageTx(paraName string, key string, link []byte, value string) (*Transaction, error) {
payload := &StorageAction{Ty: TyLinkStorageAction, Value: &StorageAction_LinkStorage{&LinkNotaryStorage{ payload := &StorageAction{
Link: link, Ty: TyLinkStorageAction, Value: &StorageAction_LinkStorage{&LinkNotaryStorage{
Key: key, Link: link,
Value: value, Key: key,
XXX_NoUnkeyedLiteral: struct{}{}, Value: value,
XXX_unrecognized: nil, XXX_NoUnkeyedLiteral: struct{}{},
XXX_sizecache: 0, XXX_unrecognized: nil,
}}, XXX_sizecache: 0,
}},
} }
if paraName == "" { if paraName == "" {
tx := &Transaction{Execer: []byte(StorageX), Payload: Encode(payload), Fee: 1e5, Nonce: rand.Int63(), To: Addr} tx := &Transaction{Execer: []byte(StorageX), Payload: Encode(payload), Fee: 1e5, Nonce: rand.Int63(), To: Addr}
...@@ -64,16 +67,17 @@ func CreateLinkStorageTx(paraName string, key string, link []byte, value string) ...@@ -64,16 +67,17 @@ func CreateLinkStorageTx(paraName string, key string, link []byte, value string)
} }
} }
//hash存证 // hash存证
func CreateHashStorageTx(paraName string, key string, hash []byte, value string) (*Transaction, error) { func CreateHashStorageTx(paraName string, key string, hash []byte, value string) (*Transaction, error) {
payload := &StorageAction{Ty: TyHashStorageAction, Value: &StorageAction_HashStorage{&HashOnlyNotaryStorage{ payload := &StorageAction{
Hash: hash, Ty: TyHashStorageAction, Value: &StorageAction_HashStorage{&HashOnlyNotaryStorage{
Key: key, Hash: hash,
Value: value, Key: key,
XXX_NoUnkeyedLiteral: struct{}{}, Value: value,
XXX_unrecognized: nil, XXX_NoUnkeyedLiteral: struct{}{},
XXX_sizecache: 0, XXX_unrecognized: nil,
}}, XXX_sizecache: 0,
}},
} }
if paraName == "" { if paraName == "" {
tx := &Transaction{Execer: []byte(StorageX), Payload: Encode(payload), Fee: 1e5, Nonce: rand.Int63(), To: Addr} tx := &Transaction{Execer: []byte(StorageX), Payload: Encode(payload), Fee: 1e5, Nonce: rand.Int63(), To: Addr}
...@@ -84,18 +88,19 @@ func CreateHashStorageTx(paraName string, key string, hash []byte, value string) ...@@ -84,18 +88,19 @@ func CreateHashStorageTx(paraName string, key string, hash []byte, value string)
} }
} }
//隐私加密存储 // 隐私加密存储
func CreateEncryptStorageTx(paraName string, key string, contentHash, encryptContent, nonce []byte, value string) *Transaction { func CreateEncryptStorageTx(paraName string, key string, contentHash, encryptContent, nonce []byte, value string) *Transaction {
payload := &StorageAction{Ty: TyEncryptStorageAction, Value: &StorageAction_EncryptStorage{&EncryptNotaryStorage{ payload := &StorageAction{
ContentHash: contentHash, Ty: TyEncryptStorageAction, Value: &StorageAction_EncryptStorage{&EncryptNotaryStorage{
EncryptContent: encryptContent, ContentHash: contentHash,
Nonce: nonce, EncryptContent: encryptContent,
Key: key, Nonce: nonce,
Value: value, Key: key,
XXX_NoUnkeyedLiteral: struct{}{}, Value: value,
XXX_unrecognized: nil, XXX_NoUnkeyedLiteral: struct{}{},
XXX_sizecache: 0, XXX_unrecognized: nil,
}}, XXX_sizecache: 0,
}},
} }
if paraName == "" { if paraName == "" {
tx := &Transaction{Execer: []byte(StorageX), Payload: Encode(payload), Fee: 1e5, Nonce: rand.Int63(), To: Addr} tx := &Transaction{Execer: []byte(StorageX), Payload: Encode(payload), Fee: 1e5, Nonce: rand.Int63(), To: Addr}
...@@ -106,18 +111,19 @@ func CreateEncryptStorageTx(paraName string, key string, contentHash, encryptCon ...@@ -106,18 +111,19 @@ func CreateEncryptStorageTx(paraName string, key string, contentHash, encryptCon
} }
} }
//分享隐私加密存储 // 分享隐私加密存储
func CreateEncryptShareStorageTx(paraName string, key string, contentHash, encryptContent, publickey []byte, value string) *Transaction { func CreateEncryptShareStorageTx(paraName string, key string, contentHash, encryptContent, publickey []byte, value string) *Transaction {
payload := &StorageAction{Ty: TyEncryptShareStorageAction, Value: &StorageAction_EncryptShareStorage{&EncryptShareNotaryStorage{ payload := &StorageAction{
ContentHash: contentHash, Ty: TyEncryptShareStorageAction, Value: &StorageAction_EncryptShareStorage{&EncryptShareNotaryStorage{
EncryptContent: encryptContent, ContentHash: contentHash,
PubKey: publickey, EncryptContent: encryptContent,
Key: key, PubKey: publickey,
Value: value, Key: key,
XXX_NoUnkeyedLiteral: struct{}{}, Value: value,
XXX_unrecognized: nil, XXX_NoUnkeyedLiteral: struct{}{},
XXX_sizecache: 0, XXX_unrecognized: nil,
}}, XXX_sizecache: 0,
}},
} }
if paraName == "" { if paraName == "" {
tx := &Transaction{Execer: []byte(StorageX), Payload: Encode(payload), Fee: 1e5, Nonce: rand.Int63(), To: Addr} tx := &Transaction{Execer: []byte(StorageX), Payload: Encode(payload), Fee: 1e5, Nonce: rand.Int63(), To: Addr}
......
package storage package storage
import ( import (
sdk "github.com/33cn/chain33-sdk-go"
"github.com/33cn/chain33-sdk-go/client"
"github.com/33cn/chain33-sdk-go/crypto"
"github.com/33cn/chain33-sdk-go/types"
. "github.com/33cn/chain33-sdk-go/dapp"
"github.com/stretchr/testify/assert"
"testing" "testing"
"time" "time"
"github.com/stretchr/testify/assert"
sdk "gitlab.33.cn/link33/chain33-sdk-go"
"gitlab.33.cn/link33/chain33-sdk-go/client"
"gitlab.33.cn/link33/chain33-sdk-go/crypto"
. "gitlab.33.cn/link33/chain33-sdk-go/dapp"
"gitlab.33.cn/link33/chain33-sdk-go/types"
) )
var ( var (
...@@ -18,7 +18,7 @@ var ( ...@@ -18,7 +18,7 @@ var (
) )
func TestCreateContentStorageTx(t *testing.T) { func TestCreateContentStorageTx(t *testing.T) {
//第一次存储 // 第一次存储
tx, err := CreateContentStorageTx("", OpCreate, "", []byte("hello"), "") tx, err := CreateContentStorageTx("", OpCreate, "", []byte("hello"), "")
assert.Nil(t, err) assert.Nil(t, err)
hexbytes, _ := types.FromHex(privkey) hexbytes, _ := types.FromHex(privkey)
...@@ -34,7 +34,7 @@ func TestCreateContentStorageTx(t *testing.T) { ...@@ -34,7 +34,7 @@ func TestCreateContentStorageTx(t *testing.T) {
detail, err := jsonclient.QueryTransaction(txhash) detail, err := jsonclient.QueryTransaction(txhash)
assert.Nil(t, err) assert.Nil(t, err)
assert.Equal(t, types.ExecOk, int(detail.Receipt.Ty)) assert.Equal(t, types.ExecOk, int(detail.Receipt.Ty))
//查询 // 查询
storage, err := QueryStorageByKey("", url, txhash) storage, err := QueryStorageByKey("", url, txhash)
assert.Nil(t, err) assert.Nil(t, err)
assert.Equal(t, []byte("hello"), storage.GetContentStorage().Content) assert.Equal(t, []byte("hello"), storage.GetContentStorage().Content)
...@@ -50,14 +50,13 @@ func TestCreateContentStorageTx(t *testing.T) { ...@@ -50,14 +50,13 @@ func TestCreateContentStorageTx(t *testing.T) {
//storage,err=QueryStorageByKey("",url,txhash) //storage,err=QueryStorageByKey("",url,txhash)
//assert.Nil(t,err) //assert.Nil(t,err)
//assert.Equal(t,[]byte("hello,world"),storage.GetContentStorage().Content) //assert.Equal(t,[]byte("hello,world"),storage.GetContentStorage().Content)
} }
//hash,or link 存证 // hash,or link 存证
func TestCreateHashStorageTx(t *testing.T) { func TestCreateHashStorageTx(t *testing.T) {
tx, err := CreateHashStorageTx("", "", []byte("123456harrylee"), "") tx, err := CreateHashStorageTx("", "", []byte("123456harrylee"), "")
assert.Nil(t, err) assert.Nil(t, err)
//签名 // 签名
hexbytes, _ := types.FromHex(privkey) hexbytes, _ := types.FromHex(privkey)
sdk.Sign(tx, hexbytes, crypto.SECP256K1, nil) sdk.Sign(tx, hexbytes, crypto.SECP256K1, nil)
txhash := types.ToHexPrefix(sdk.Hash(tx)) txhash := types.ToHexPrefix(sdk.Hash(tx))
...@@ -71,13 +70,13 @@ func TestCreateHashStorageTx(t *testing.T) { ...@@ -71,13 +70,13 @@ func TestCreateHashStorageTx(t *testing.T) {
detail, err := jsonclient.QueryTransaction(txhash) detail, err := jsonclient.QueryTransaction(txhash)
assert.Nil(t, err) assert.Nil(t, err)
assert.Equal(t, types.ExecOk, int(detail.Receipt.Ty)) assert.Equal(t, types.ExecOk, int(detail.Receipt.Ty))
//查询 // 查询
storage, err := QueryStorageByKey("", url, txhash) storage, err := QueryStorageByKey("", url, txhash)
assert.Nil(t, err) assert.Nil(t, err)
assert.Equal(t, []byte("123456harrylee"), storage.GetHashStorage().Hash) assert.Equal(t, []byte("123456harrylee"), storage.GetHashStorage().Hash)
} }
//hash,or link 存证 // hash,or link 存证
func TestCreateLinkStorageTx(t *testing.T) { func TestCreateLinkStorageTx(t *testing.T) {
tx, err := CreateLinkStorageTx("", "", []byte("hello"), "") tx, err := CreateLinkStorageTx("", "", []byte("hello"), "")
assert.Nil(t, err) assert.Nil(t, err)
...@@ -103,5 +102,4 @@ func TestByteFromHex(t *testing.T) { ...@@ -103,5 +102,4 @@ func TestByteFromHex(t *testing.T) {
t.Error(err) t.Error(err)
} }
t.Log(string(data)) t.Log(string(data))
} }
...@@ -5,9 +5,9 @@ import ( ...@@ -5,9 +5,9 @@ import (
"math/rand" "math/rand"
"time" "time"
sdk "github.com/33cn/chain33-sdk-go" sdk "gitlab.33.cn/link33/chain33-sdk-go"
"github.com/33cn/chain33-sdk-go/crypto" "gitlab.33.cn/link33/chain33-sdk-go/crypto"
"github.com/33cn/chain33-sdk-go/types" "gitlab.33.cn/link33/chain33-sdk-go/types"
) )
var r *rand.Rand var r *rand.Rand
...@@ -47,7 +47,7 @@ func CreateWasmCallTx(paraName, contract, method string, param []int64, env []st ...@@ -47,7 +47,7 @@ func CreateWasmCallTx(paraName, contract, method string, param []int64, env []st
Contract: contract, Contract: contract,
Method: method, Method: method,
Parameters: param, Parameters: param,
Env: env, Env: env,
}, },
}, },
} }
......
package event package event
type CCEvent struct { type CCEvent struct {
//交易哈希 // 交易哈希
TxID string TxID string
//执行器名称,也可能是合约地址 // 执行器名称,也可能是合约地址
CCID string CCID string
//事件名称,go中表示actionName // 事件名称,go中表示actionName
EventName string EventName string
//信息载体 // 信息载体
Payload []byte Payload []byte
//交易所在区块高度 // 交易所在区块高度
BlockNumber uint64 BlockNumber uint64
} }
type Registration interface{}
type EventService interface {
//注册区块监听
//RegisterBlockEvent(filter ...BlockFilter) (chan <-Registration, <-chan *BlockEvent, error)
//注册交易时间监听 type (
RegisterTxEvent(ccID, eventFilter string) (chan <-Registration,<-chan *CCEvent, error) Registration interface{}
EventService interface {
// 注册区块监听
// RegisterBlockEvent(filter ...BlockFilter) (chan <-Registration, <-chan *BlockEvent, error)
} // 注册交易时间监听
\ No newline at end of file RegisterTxEvent(ccID, eventFilter string) (chan<- Registration, <-chan *CCEvent, error)
}
)
module github.com/33cn/chain33-sdk-go module gitlab.33.cn/link33/chain33-sdk-go
go 1.12 go 1.12
...@@ -19,7 +19,7 @@ require ( ...@@ -19,7 +19,7 @@ require (
golang.org/x/net v0.0.0-20191105084925-a882066a44e0 // indirect golang.org/x/net v0.0.0-20191105084925-a882066a44e0 // indirect
golang.org/x/text v0.3.2 // indirect golang.org/x/text v0.3.2 // indirect
google.golang.org/grpc v1.29.1 google.golang.org/grpc v1.29.1
google.golang.org/protobuf v1.25.0 google.golang.org/protobuf v1.25.0 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/yaml.v2 v2.2.4 // indirect gopkg.in/yaml.v2 v2.2.4 // indirect
) )
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y= github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y=
...@@ -18,9 +17,7 @@ github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46f ...@@ -18,9 +17,7 @@ github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46f
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495 h1:6IyqGr3fnd0tM3YxipK27TUskaOVUjU2nG45yzwcQKY=
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
...@@ -28,7 +25,6 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF ...@@ -28,7 +25,6 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
...@@ -37,8 +33,6 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb ...@@ -37,8 +33,6 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk=
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
...@@ -48,12 +42,11 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD ...@@ -48,12 +42,11 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD
github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/inconshreveable/log15 v0.0.0-20201112154412-8562bdadbbac h1:n1DqxAo4oWPMvH1+v+DLYlMCecgumhhgnxAPdqDIFHI= github.com/inconshreveable/log15 v0.0.0-20201112154412-8562bdadbbac h1:n1DqxAo4oWPMvH1+v+DLYlMCecgumhhgnxAPdqDIFHI=
github.com/inconshreveable/log15 v0.0.0-20201112154412-8562bdadbbac/go.mod h1:cOaXtrgN4ScfRrD9Bre7U1thNq5RtJ8ZoP4iXVGRj6o= github.com/inconshreveable/log15 v0.0.0-20201112154412-8562bdadbbac/go.mod h1:cOaXtrgN4ScfRrD9Bre7U1thNq5RtJ8ZoP4iXVGRj6o=
...@@ -77,13 +70,11 @@ github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa ...@@ -77,13 +70,11 @@ github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/tjfoc/gmsm v1.3.2 h1:7JVkAn5bvUJ7HtU08iW6UiD+UTmJTIToHCfeFzkcCxM= github.com/tjfoc/gmsm v1.3.2 h1:7JVkAn5bvUJ7HtU08iW6UiD+UTmJTIToHCfeFzkcCxM=
github.com/tjfoc/gmsm v1.3.2/go.mod h1:HaUcFuY0auTiaHB9MHFGCPx5IaLhTUd2atbCFBQXn9w= github.com/tjfoc/gmsm v1.3.2/go.mod h1:HaUcFuY0auTiaHB9MHFGCPx5IaLhTUd2atbCFBQXn9w=
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44 h1:9lP3x0pW80sDI6t1UMSLA4to18W7R7imwAI/sWS9S8Q=
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191219195013-becbf705a915 h1:aJ0ex187qoXrJHPo8ZasVTASQB7llQP6YeNzgDALPRk= golang.org/x/crypto v0.0.0-20191219195013-becbf705a915 h1:aJ0ex187qoXrJHPo8ZasVTASQB7llQP6YeNzgDALPRk=
...@@ -97,14 +88,12 @@ golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73r ...@@ -97,14 +88,12 @@ golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73r
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20191105084925-a882066a44e0 h1:QPlSTtPE2k6PZPasQUbzuK3p9JbS+vMXYVto8g/yrsg= golang.org/x/net v0.0.0-20191105084925-a882066a44e0 h1:QPlSTtPE2k6PZPasQUbzuK3p9JbS+vMXYVto8g/yrsg=
golang.org/x/net v0.0.0-20191105084925-a882066a44e0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191105084925-a882066a44e0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
...@@ -120,13 +109,12 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm ...@@ -120,13 +109,12 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 h1:5Beo0mZN8dRzgrMMkDp0jc8YXQKx9DiJ2k1dkvGsn5A=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
...@@ -142,21 +130,16 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ ...@@ -142,21 +130,16 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
......
...@@ -5,16 +5,17 @@ import ( ...@@ -5,16 +5,17 @@ import (
"crypto/sha256" "crypto/sha256"
"errors" "errors"
"fmt" "fmt"
"github.com/33cn/chain33-sdk-go/crypto"
"github.com/33cn/chain33-sdk-go/types"
secp256k1 "github.com/btcsuite/btcd/btcec"
"math/big" "math/big"
secp256k1 "github.com/btcsuite/btcd/btcec"
"gitlab.33.cn/link33/chain33-sdk-go/crypto"
"gitlab.33.cn/link33/chain33-sdk-go/types"
) )
var baseN = secp256k1.S256().Params().N var baseN = secp256k1.S256().Params().N
const ( const (
encKeyLength = 16 // 对称秘钥长度,兼容jdk encKeyLength = 16 // 对称秘钥长度,兼容jdk
) )
type KFrag struct { type KFrag struct {
...@@ -63,8 +64,8 @@ func (p *EccPoit) MulInt(i *big.Int) *EccPoit { ...@@ -63,8 +64,8 @@ func (p *EccPoit) MulInt(i *big.Int) *EccPoit {
func (p *EccPoit) ToPublicKey() *secp256k1.PublicKey { func (p *EccPoit) ToPublicKey() *secp256k1.PublicKey {
return &secp256k1.PublicKey{ return &secp256k1.PublicKey{
X: p.x, X: p.x,
Y: p.y, Y: p.y,
Curve: secp256k1.S256(), Curve: secp256k1.S256(),
} }
} }
...@@ -86,7 +87,7 @@ func hashToModInt(digest []byte) *big.Int { ...@@ -86,7 +87,7 @@ func hashToModInt(digest []byte) *big.Int {
func makeShamirPolyCoeff(threshold int) []*big.Int { func makeShamirPolyCoeff(threshold int) []*big.Int {
coeffs := make([]*big.Int, threshold-1) coeffs := make([]*big.Int, threshold-1)
for i,_ := range coeffs { for i := range coeffs {
coeffs[i] = new(big.Int).SetBytes(crypto.GeneratePrivateKey()) coeffs[i] = new(big.Int).SetBytes(crypto.GeneratePrivateKey())
} }
...@@ -184,15 +185,15 @@ func GenerateKeyFragments(privOwner []byte, pubRecipient []byte, numSplit, thres ...@@ -184,15 +185,15 @@ func GenerateKeyFragments(privOwner []byte, pubRecipient []byte, numSplit, thres
kFrags := make([]*KFrag, numSplit) kFrags := make([]*KFrag, numSplit)
if numSplit == 1 { if numSplit == 1 {
id := getRandomInt(baseN.BitLen()-1) id := getRandomInt(baseN.BitLen() - 1)
kFrags[0] = &KFrag{Random: id.String(), Value: f0.String(), PrecurPub: precurPub} kFrags[0] = &KFrag{Random: id.String(), Value: f0.String(), PrecurPub: precurPub}
} else { } else {
coeffs := makeShamirPolyCoeff(threshold) coeffs := makeShamirPolyCoeff(threshold)
coeffs = append(coeffs, f0) coeffs = append(coeffs, f0)
// rk[i] = f2*id^2 + f1*id + f0 // rk[i] = f2*id^2 + f1*id + f0
for i, _ := range kFrags { for i := range kFrags {
id := getRandomInt(baseN.BitLen()-1) id := getRandomInt(baseN.BitLen() - 1)
dShareHash := sha256.New() dShareHash := sha256.New()
dShareHash.Write(precursor.X.Bytes()) dShareHash.Write(precursor.X.Bytes())
dShareHash.Write(pubRecipientKey.X.Bytes()) dShareHash.Write(pubRecipientKey.X.Bytes())
...@@ -241,14 +242,14 @@ func AssembleReencryptFragment(privRecipient []byte, reKeyFrags []*ReKeyFrag) ([ ...@@ -241,14 +242,14 @@ func AssembleReencryptFragment(privRecipient []byte, reKeyFrags []*ReKeyFrag) ([
var eFinal, vFinal *EccPoit var eFinal, vFinal *EccPoit
ids := make([]*big.Int, len(reKeyFrags)) ids := make([]*big.Int, len(reKeyFrags))
for x, _ := range ids { for x := range ids {
xs := sha256.New() xs := sha256.New()
xs.Write(precursorPubKey.X.Bytes()) xs.Write(precursorPubKey.X.Bytes())
xs.Write(privRecipientKey.X.Bytes()) xs.Write(privRecipientKey.X.Bytes())
xs.Write(dh_Bob_poit_x) xs.Write(dh_Bob_poit_x)
random, ret := new(big.Int).SetString(reKeyFrags[x].Random, 10) random, ret := new(big.Int).SetString(reKeyFrags[x].Random, 10)
if !ret { if !ret {
fmt.Errorf("AssembleReencryptFragment.get value int",) fmt.Errorf("AssembleReencryptFragment.get value int")
return nil, errors.New("get big int value from keyFragment failed") return nil, errors.New("get big int value from keyFragment failed")
} }
xs.Write(random.Bytes()) xs.Write(random.Bytes())
...@@ -280,4 +281,4 @@ func AssembleReencryptFragment(privRecipient []byte, reKeyFrags []*ReKeyFrag) ([ ...@@ -280,4 +281,4 @@ func AssembleReencryptFragment(privRecipient []byte, reKeyFrags []*ReKeyFrag) ([
share_key := crypto.KDF(result.ToPublicKey().SerializeCompressed(), encKeyLength) share_key := crypto.KDF(result.ToPublicKey().SerializeCompressed(), encKeyLength)
return share_key, nil return share_key, nil
} }
\ No newline at end of file
...@@ -2,45 +2,46 @@ package sdk ...@@ -2,45 +2,46 @@ package sdk
import ( import (
"fmt" "fmt"
"github.com/33cn/chain33-sdk-go/client"
"github.com/33cn/chain33-sdk-go/crypto"
"github.com/33cn/chain33-sdk-go/types"
"github.com/stretchr/testify/assert"
"testing" "testing"
"github.com/stretchr/testify/assert"
"gitlab.33.cn/link33/chain33-sdk-go/client"
"gitlab.33.cn/link33/chain33-sdk-go/crypto"
"gitlab.33.cn/link33/chain33-sdk-go/types"
) )
type ReqSendKeyFragment struct { type ReqSendKeyFragment struct {
PubOwner string `protobuf:"bytes,1,opt,name=pubOwner,proto3" json:"pubOwner,omitempty"` PubOwner string `protobuf:"bytes,1,opt,name=pubOwner,proto3" json:"pubOwner,omitempty"`
PubRecipient string `protobuf:"bytes,2,opt,name=pubRecipient,proto3" json:"pubRecipient,omitempty"` PubRecipient string `protobuf:"bytes,2,opt,name=pubRecipient,proto3" json:"pubRecipient,omitempty"`
PubProofR string `protobuf:"bytes,3,opt,name=pubProofR,proto3" json:"pubProofR,omitempty"` PubProofR string `protobuf:"bytes,3,opt,name=pubProofR,proto3" json:"pubProofR,omitempty"`
PubProofU string `protobuf:"bytes,4,opt,name=pubProofU,proto3" json:"pubProofU,omitempty"` PubProofU string `protobuf:"bytes,4,opt,name=pubProofU,proto3" json:"pubProofU,omitempty"`
Random string `protobuf:"bytes,5,opt,name=random,proto3" json:"random,omitempty"` Random string `protobuf:"bytes,5,opt,name=random,proto3" json:"random,omitempty"`
Value string `protobuf:"bytes,6,opt,name=value,proto3" json:"value,omitempty"` Value string `protobuf:"bytes,6,opt,name=value,proto3" json:"value,omitempty"`
Expire int64 `protobuf:"varint,7,opt,name=expire,proto3" json:"expire,omitempty"` Expire int64 `protobuf:"varint,7,opt,name=expire,proto3" json:"expire,omitempty"`
DhProof string `protobuf:"bytes,8,opt,name=dhProof,proto3" json:"dhProof,omitempty"` DhProof string `protobuf:"bytes,8,opt,name=dhProof,proto3" json:"dhProof,omitempty"`
PrecurPub string `protobuf:"bytes,9,opt,name=precurPub,proto3" json:"precurPub,omitempty"` PrecurPub string `protobuf:"bytes,9,opt,name=precurPub,proto3" json:"precurPub,omitempty"`
} }
type ReqReeencryptParam struct { type ReqReeencryptParam struct {
PubOwner string `protobuf:"bytes,1,opt,name=pubOwner,proto3" json:"pubOwner,omitempty"` PubOwner string `protobuf:"bytes,1,opt,name=pubOwner,proto3" json:"pubOwner,omitempty"`
PubRecipient string `protobuf:"bytes,2,opt,name=pubRecipient,proto3" json:"pubRecipient,omitempty"` PubRecipient string `protobuf:"bytes,2,opt,name=pubRecipient,proto3" json:"pubRecipient,omitempty"`
} }
type RepReeencrypt struct { type RepReeencrypt struct {
ReKeyR string `protobuf:"bytes,1,opt,name=reKeyR,proto3" json:"reKeyR,omitempty"` ReKeyR string `protobuf:"bytes,1,opt,name=reKeyR,proto3" json:"reKeyR,omitempty"`
ReKeyU string `protobuf:"bytes,2,opt,name=reKeyU,proto3" json:"reKeyU,omitempty"` ReKeyU string `protobuf:"bytes,2,opt,name=reKeyU,proto3" json:"reKeyU,omitempty"`
Random string `protobuf:"bytes,3,opt,name=random,proto3" json:"random,omitempty"` Random string `protobuf:"bytes,3,opt,name=random,proto3" json:"random,omitempty"`
PrecurPub string `protobuf:"bytes,4,opt,name=precurPub,proto3" json:"precurPub,omitempty"` PrecurPub string `protobuf:"bytes,4,opt,name=precurPub,proto3" json:"precurPub,omitempty"`
} }
func TestPre(t *testing.T) { func TestPre(t *testing.T) {
privOwner,_ := types.FromHex("6d52c4680c00dcdb9d904dc6878a8e1c753ecf9c43a48499d819fdc0eafa4639") privOwner, _ := types.FromHex("6d52c4680c00dcdb9d904dc6878a8e1c753ecf9c43a48499d819fdc0eafa4639")
pubOwner,_ := types.FromHex("02e5fdf78aded517e3235c2276ed0e020226c55835dea7b8306f2e8d3d99d2d4f4") pubOwner, _ := types.FromHex("02e5fdf78aded517e3235c2276ed0e020226c55835dea7b8306f2e8d3d99d2d4f4")
serverPub,_ := types.FromHex("02005d3a38feaff00f1b83014b2602d7b5b39506ddee7919dd66539b5428358f08") serverPub, _ := types.FromHex("02005d3a38feaff00f1b83014b2602d7b5b39506ddee7919dd66539b5428358f08")
privRecipient, _ := types.FromHex("841e3b4ab211eecfccb475940171150fd1536cb656c870fe95d206ebf9732b6c") privRecipient, _ := types.FromHex("841e3b4ab211eecfccb475940171150fd1536cb656c870fe95d206ebf9732b6c")
pubRecipient, _ := types.FromHex("03b9d801f88c38522a9bf786f23544259d516ee0d1f6699f926f891ac3fb92c6d9") pubRecipient, _ := types.FromHex("03b9d801f88c38522a9bf786f23544259d516ee0d1f6699f926f891ac3fb92c6d9")
msg := "hello proxy-re-encrypt" msg := "hello proxy-re-encrypt"
serverList := []string {"http://192.168.0.155:11801", "http://192.168.0.155:11802", "http://192.168.0.155:11803"} serverList := []string{"http://192.168.0.155:11801", "http://192.168.0.155:11802", "http://192.168.0.155:11803"}
enKey, pub_r, pub_u := GeneratePreEncryptKey(pubOwner) enKey, pub_r, pub_u := GeneratePreEncryptKey(pubOwner)
cipher, err := crypto.AESCBCPKCS7Encrypt(enKey, []byte(msg)) cipher, err := crypto.AESCBCPKCS7Encrypt(enKey, []byte(msg))
...@@ -80,12 +81,12 @@ func TestPre(t *testing.T) { ...@@ -80,12 +81,12 @@ func TestPre(t *testing.T) {
} }
param := &ReqReeencryptParam{ param := &ReqReeencryptParam{
PubOwner: types.ToHex(pubOwner), PubOwner: types.ToHex(pubOwner),
PubRecipient: types.ToHex(pubRecipient), PubRecipient: types.ToHex(pubRecipient),
} }
var rekeys = make([]*ReKeyFrag, 2) rekeys := make([]*ReKeyFrag, 2)
for i:=0; i < 2; i++ { for i := 0; i < 2; i++ {
jclient, err := client.NewJSONClient("Pre", serverList[i]) jclient, err := client.NewJSONClient("Pre", serverList[i])
if err != nil { if err != nil {
panic(err) panic(err)
...@@ -100,7 +101,7 @@ func TestPre(t *testing.T) { ...@@ -100,7 +101,7 @@ func TestPre(t *testing.T) {
PrecurPub: result.PrecurPub, PrecurPub: result.PrecurPub,
} }
} }
encKey,err := AssembleReencryptFragment(privRecipient, rekeys) encKey, err := AssembleReencryptFragment(privRecipient, rekeys)
if err != nil { if err != nil {
panic(err) panic(err)
} }
......
syntax = "proto3"; syntax = "proto3";
package types; package types;
//option go_package = "../types"; // option go_package = "../types";
message BrokerAction { message BrokerAction {
oneof value { oneof value {
Register register = 1; Register register = 1;
Audit audit = 2; Audit audit = 2;
InterchainEvent emitInterchainEvent = 3; InterchainEvent emitInterchainEvent = 3;
UpdateIndex updateIndex =4; UpdateIndex updateIndex = 4;
} }
int32 ty = 5; int32 ty = 5;
} }
...@@ -18,75 +18,75 @@ message Register { ...@@ -18,75 +18,75 @@ message Register {
//审核 //审核
message Audit { message Audit {
//业务合约名称 //业务合约名称
string exectorName = 1; string exectorName = 1;
//状态码 0表示正在审核,1表示审核通过,2表示审核失败 //状态码 0表示正在审核,1表示审核通过,2表示审核失败
string status = 2; string status = 2;
} }
// 轮循事件 // 轮循事件
message PollingEvent { message PollingEvent {
Meta meta = 1; Meta meta = 1;
} }
// 更新跨链事件索引 // 更新跨链事件索引
message UpdateIndex { message UpdateIndex {
//当前链已经处理到的位置 //当前链已经处理到的位置
uint64 sequenceNum = 1; uint64 sequenceNum = 1;
//目的链服务ID,固定格式0x000001 //目的链服务ID,固定格式0x000001
string dstServiceID = 2; string dstServiceID = 2;
//源链ID,固定格式0x000002 //源链ID,固定格式0x000002
string srcServiceID = 3; string srcServiceID = 3;
//请求类型 0表示信息流入 1表示信息流出 2表示回滚 //请求类型 0表示信息流入 1表示信息流出 2表示回滚
uint64 reqType =4; uint64 reqType = 4;
//响应信息 //响应信息
Response response = 5; Response response = 5;
} }
// 跨链事件 // 跨链事件
message InterchainEvent { message InterchainEvent {
//索引值,这个有系统自动生成 //索引值,这个有系统自动生成
uint64 index = 1; uint64 index = 1;
//目的链ID,固定格式0x000001 //目的链ID,固定格式0x000001
string dstServiceID = 2; string dstServiceID = 2;
//源链ID,固定格式0x000002 //源链ID,固定格式0x000002
string srcServiceID = 3; string srcServiceID = 3;
//跨链交易类型 0表示storage,1表示coins,2表示token...... //跨链交易类型 0表示storage,1表示coins,2表示token......
uint64 type =4; uint64 type = 4;
//调用方法 //调用方法
string func = 5; string func = 5;
//参数列表 //参数列表
repeated string args = 6; repeated string args = 6;
//状态 0表示开始处理 1表示跨链成功 2表示跨链失败 //状态 0表示开始处理 1表示跨链成功 2表示跨链失败
int32 status = 7; int32 status = 7;
} }
//ReceiptBrokerLog // ReceiptBrokerLog
message ReceiptBrokerLog{ message ReceiptBrokerLog {
oneof value { oneof value {
Register register = 1; Register register = 1;
Audit audit = 2; Audit audit = 2;
InterchainEvent emitInterchainEvent = 3; InterchainEvent emitInterchainEvent = 3;
UpdateIndex updateIndex =4; UpdateIndex updateIndex = 4;
} }
int32 ty = 5; int32 ty = 5;
} }
service broker {} service broker {}
//查询跨出事件 //查询跨出事件
message QueryInterchainEvent{ message QueryInterchainEvent {
uint64 index =1; uint64 index = 1;
//目的链ID,固定格式0x000001 //目的链ID,固定格式0x000001
string dstServiceID = 2; string dstServiceID = 2;
//源链ID,固定格式0x000002 //源链ID,固定格式0x000002
string srcServiceID = 3; string srcServiceID = 3;
} }
//跨链事件列表 //跨链事件列表
message InterChainEventList{ message InterChainEventList {
repeated InterchainEvent list =1; repeated InterchainEvent list = 1;
} }
////根据状态查看跨链事件 ////根据状态查看跨链事件
//message QueryInterchainEventList { // message QueryInterchainEventList {
// //事件状态必填(默认是0,只查询待处理状态的事件) // //事件状态必填(默认是0,只查询待处理状态的事件)
// int32 status = 1; // int32 status = 1;
// // 主键索引 // // 主键索引
...@@ -97,46 +97,40 @@ message InterChainEventList{ ...@@ -97,46 +97,40 @@ message InterChainEventList{
// int32 direction = 4; // int32 direction = 4;
//} //}
////跨链事件列表 ////跨链事件列表
//message InterchainEventList { // message InterchainEventList {
// repeated InterchainEvent list = 1; // repeated InterchainEvent list = 1;
// string primaryKey = 2; // string primaryKey = 2;
//} //}
message QueryOutterMeta{ message QueryOutterMeta {}
}
message QueryInnerMeta{
} message QueryInnerMeta {}
message QueryNilParam{ message QueryNilParam {}
}
message QueryInMessage{ message QueryInMessage {
string inServicePair = 1; string inServicePair = 1;
uint64 sequenceNum = 2; uint64 sequenceNum = 2;
} }
message QueryOutMessage{ message QueryOutMessage {
string inServicePair = 1; string inServicePair = 1;
uint64 sequenceNum = 2; uint64 sequenceNum = 2;
} }
message Meta { message Meta {
map<string,uint64> meta = 1; map<string, uint64> meta = 1;
} }
message BrokerInfo { message BrokerInfo {
//跨链协议版本ID //跨链协议版本ID
string bxhId =1; string bxhId = 1;
//应用链ID //应用链ID
string appChainId = 2; string appChainId = 2;
} }
message Response{ message Response {
// A status code that should follow the HTTP status codes. // A status code that should follow the HTTP status codes.
int32 status = 1; int32 status = 1;
// A message associated with the response code. // A message associated with the response code.
string message = 2; string message = 2;
// A payload that can be used to include metadata with this response. // A payload that can be used to include metadata with this response.
bytes payload = 3; bytes payload = 3;
} }
\ No newline at end of file
syntax = "proto3"; syntax = "proto3";
package types; package types;
//option go_package = "github.com/33cn/chain33/types"; // option go_package = "github.com/33cn/chain33/types";
message Reply { message Reply {
bool isOk = 1; bool isOk = 1;
......
...@@ -31,7 +31,7 @@ message ContentOnlyNotaryStorage { ...@@ -31,7 +31,7 @@ message ContentOnlyNotaryStorage {
//自定义的主键,可以为空,如果没传,则用txhash为key //自定义的主键,可以为空,如果没传,则用txhash为key
string key = 2; string key = 2;
// Op 0表示创建 1表示追加add // Op 0表示创建 1表示追加add
int32 op = 3; int32 op = 3;
//字符串值 //字符串值
string value = 4; string value = 4;
} }
...@@ -109,5 +109,4 @@ message BatchReplyStorage { ...@@ -109,5 +109,4 @@ message BatchReplyStorage {
repeated Storage storages = 1; repeated Storage storages = 1;
} }
message ReceiptStorage { message ReceiptStorage {}
} \ No newline at end of file
\ No newline at end of file
...@@ -3,46 +3,45 @@ syntax = "proto3"; ...@@ -3,46 +3,45 @@ syntax = "proto3";
package types; package types;
message wasmAction { message wasmAction {
oneof value { oneof value {
wasmCreate create = 1; wasmCreate create = 1;
wasmCall call = 2; wasmCall call = 2;
} }
int32 ty = 3; int32 ty = 3;
} }
message wasmCreate { message wasmCreate {
string name = 1; string name = 1;
bytes code = 2; bytes code = 2;
} }
message wasmCall { message wasmCall {
string contract = 1; string contract = 1;
string method = 2; string method = 2;
repeated int64 parameters = 3; repeated int64 parameters = 3;
repeated string env = 4; repeated string env = 4;
} }
message queryCheckContract { message queryCheckContract {
string name = 1; string name = 1;
} }
message customLog { message customLog {
repeated string info = 1; repeated string info = 1;
} }
message createContractLog { message createContractLog {
string name = 1; string name = 1;
string code = 2; string code = 2;
} }
message callContractLog { message callContractLog {
string contract = 1; string contract = 1;
string method = 2; string method = 2;
int32 result = 3; int32 result = 3;
} }
message localDataLog { message localDataLog {
bytes key = 1; bytes key = 1;
bytes value = 2; bytes value = 2;
} }
...@@ -2,10 +2,11 @@ package sdk ...@@ -2,10 +2,11 @@ package sdk
import ( import (
"errors" "errors"
"github.com/33cn/chain33-sdk-go/crypto"
"github.com/33cn/chain33-sdk-go/crypto/ed25519" "gitlab.33.cn/link33/chain33-sdk-go/crypto"
"github.com/33cn/chain33-sdk-go/crypto/gm" "gitlab.33.cn/link33/chain33-sdk-go/crypto/ed25519"
. "github.com/33cn/chain33-sdk-go/types" "gitlab.33.cn/link33/chain33-sdk-go/crypto/gm"
. "gitlab.33.cn/link33/chain33-sdk-go/types"
) )
func Sign(tx *Transaction, privateKey []byte, signType string, uid []byte) (*Transaction, error) { func Sign(tx *Transaction, privateKey []byte, signType string, uid []byte) (*Transaction, error) {
...@@ -42,9 +43,9 @@ func Sign(tx *Transaction, privateKey []byte, signType string, uid []byte) (*Tra ...@@ -42,9 +43,9 @@ func Sign(tx *Transaction, privateKey []byte, signType string, uid []byte) (*Tra
data := Encode(tx) data := Encode(tx)
signature := ed25519.Sign(data, privateKey) signature := ed25519.Sign(data, privateKey)
tx.Signature = &Signature{ tx.Signature = &Signature{
Ty: 2, Ty: 2,
Pubkey: pub, Pubkey: pub,
Signature: signature, Signature: signature,
} }
} else { } else {
return nil, errors.New("sign type not support") return nil, errors.New("sign type not support")
...@@ -74,4 +75,4 @@ func Hash(tx *Transaction) []byte { ...@@ -74,4 +75,4 @@ func Hash(tx *Transaction) []byte {
copytx.Header = nil copytx.Header = nil
data := Encode(copytx) data := Encode(copytx)
return crypto.Sha256(data) return crypto.Sha256(data)
} }
\ No newline at end of file
...@@ -6,15 +6,18 @@ package types ...@@ -6,15 +6,18 @@ package types
import ( import (
context "context" context "context"
fmt "fmt" fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto" proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
math "math"
) )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal var (
var _ = fmt.Errorf _ = proto.Marshal
var _ = math.Inf _ = fmt.Errorf
_ = math.Inf
)
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
...@@ -22,7 +25,7 @@ var _ = math.Inf ...@@ -22,7 +25,7 @@ var _ = math.Inf
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
//option go_package = "../types"; // option go_package = "../types";
type BrokerAction struct { type BrokerAction struct {
// Types that are valid to be assigned to Value: // Types that are valid to be assigned to Value:
// *BrokerAction_Register // *BrokerAction_Register
...@@ -46,15 +49,19 @@ func (*BrokerAction) Descriptor() ([]byte, []int) { ...@@ -46,15 +49,19 @@ func (*BrokerAction) Descriptor() ([]byte, []int) {
func (m *BrokerAction) XXX_Unmarshal(b []byte) error { func (m *BrokerAction) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BrokerAction.Unmarshal(m, b) return xxx_messageInfo_BrokerAction.Unmarshal(m, b)
} }
func (m *BrokerAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *BrokerAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BrokerAction.Marshal(b, m, deterministic) return xxx_messageInfo_BrokerAction.Marshal(b, m, deterministic)
} }
func (m *BrokerAction) XXX_Merge(src proto.Message) { func (m *BrokerAction) XXX_Merge(src proto.Message) {
xxx_messageInfo_BrokerAction.Merge(m, src) xxx_messageInfo_BrokerAction.Merge(m, src)
} }
func (m *BrokerAction) XXX_Size() int { func (m *BrokerAction) XXX_Size() int {
return xxx_messageInfo_BrokerAction.Size(m) return xxx_messageInfo_BrokerAction.Size(m)
} }
func (m *BrokerAction) XXX_DiscardUnknown() { func (m *BrokerAction) XXX_DiscardUnknown() {
xxx_messageInfo_BrokerAction.DiscardUnknown(m) xxx_messageInfo_BrokerAction.DiscardUnknown(m)
} }
...@@ -143,7 +150,7 @@ func (*BrokerAction) XXX_OneofWrappers() []interface{} { ...@@ -143,7 +150,7 @@ func (*BrokerAction) XXX_OneofWrappers() []interface{} {
// 业务合约注册模型: 0表示正在审核,1表示审核通过,2表示审核失败 // 业务合约注册模型: 0表示正在审核,1表示审核通过,2表示审核失败
type Register struct { type Register struct {
//业务合约名称 // 业务合约名称
ExectorName string `protobuf:"bytes,1,opt,name=exectorName,proto3" json:"exectorName,omitempty"` ExectorName string `protobuf:"bytes,1,opt,name=exectorName,proto3" json:"exectorName,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
...@@ -160,15 +167,19 @@ func (*Register) Descriptor() ([]byte, []int) { ...@@ -160,15 +167,19 @@ func (*Register) Descriptor() ([]byte, []int) {
func (m *Register) XXX_Unmarshal(b []byte) error { func (m *Register) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Register.Unmarshal(m, b) return xxx_messageInfo_Register.Unmarshal(m, b)
} }
func (m *Register) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *Register) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Register.Marshal(b, m, deterministic) return xxx_messageInfo_Register.Marshal(b, m, deterministic)
} }
func (m *Register) XXX_Merge(src proto.Message) { func (m *Register) XXX_Merge(src proto.Message) {
xxx_messageInfo_Register.Merge(m, src) xxx_messageInfo_Register.Merge(m, src)
} }
func (m *Register) XXX_Size() int { func (m *Register) XXX_Size() int {
return xxx_messageInfo_Register.Size(m) return xxx_messageInfo_Register.Size(m)
} }
func (m *Register) XXX_DiscardUnknown() { func (m *Register) XXX_DiscardUnknown() {
xxx_messageInfo_Register.DiscardUnknown(m) xxx_messageInfo_Register.DiscardUnknown(m)
} }
...@@ -182,11 +193,11 @@ func (m *Register) GetExectorName() string { ...@@ -182,11 +193,11 @@ func (m *Register) GetExectorName() string {
return "" return ""
} }
//审核 // 审核
type Audit struct { type Audit struct {
//业务合约名称 // 业务合约名称
ExectorName string `protobuf:"bytes,1,opt,name=exectorName,proto3" json:"exectorName,omitempty"` ExectorName string `protobuf:"bytes,1,opt,name=exectorName,proto3" json:"exectorName,omitempty"`
//状态码 0表示正在审核,1表示审核通过,2表示审核失败 // 状态码 0表示正在审核,1表示审核通过,2表示审核失败
Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
...@@ -203,15 +214,19 @@ func (*Audit) Descriptor() ([]byte, []int) { ...@@ -203,15 +214,19 @@ func (*Audit) Descriptor() ([]byte, []int) {
func (m *Audit) XXX_Unmarshal(b []byte) error { func (m *Audit) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Audit.Unmarshal(m, b) return xxx_messageInfo_Audit.Unmarshal(m, b)
} }
func (m *Audit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *Audit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Audit.Marshal(b, m, deterministic) return xxx_messageInfo_Audit.Marshal(b, m, deterministic)
} }
func (m *Audit) XXX_Merge(src proto.Message) { func (m *Audit) XXX_Merge(src proto.Message) {
xxx_messageInfo_Audit.Merge(m, src) xxx_messageInfo_Audit.Merge(m, src)
} }
func (m *Audit) XXX_Size() int { func (m *Audit) XXX_Size() int {
return xxx_messageInfo_Audit.Size(m) return xxx_messageInfo_Audit.Size(m)
} }
func (m *Audit) XXX_DiscardUnknown() { func (m *Audit) XXX_DiscardUnknown() {
xxx_messageInfo_Audit.DiscardUnknown(m) xxx_messageInfo_Audit.DiscardUnknown(m)
} }
...@@ -250,15 +265,19 @@ func (*PollingEvent) Descriptor() ([]byte, []int) { ...@@ -250,15 +265,19 @@ func (*PollingEvent) Descriptor() ([]byte, []int) {
func (m *PollingEvent) XXX_Unmarshal(b []byte) error { func (m *PollingEvent) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PollingEvent.Unmarshal(m, b) return xxx_messageInfo_PollingEvent.Unmarshal(m, b)
} }
func (m *PollingEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *PollingEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PollingEvent.Marshal(b, m, deterministic) return xxx_messageInfo_PollingEvent.Marshal(b, m, deterministic)
} }
func (m *PollingEvent) XXX_Merge(src proto.Message) { func (m *PollingEvent) XXX_Merge(src proto.Message) {
xxx_messageInfo_PollingEvent.Merge(m, src) xxx_messageInfo_PollingEvent.Merge(m, src)
} }
func (m *PollingEvent) XXX_Size() int { func (m *PollingEvent) XXX_Size() int {
return xxx_messageInfo_PollingEvent.Size(m) return xxx_messageInfo_PollingEvent.Size(m)
} }
func (m *PollingEvent) XXX_DiscardUnknown() { func (m *PollingEvent) XXX_DiscardUnknown() {
xxx_messageInfo_PollingEvent.DiscardUnknown(m) xxx_messageInfo_PollingEvent.DiscardUnknown(m)
} }
...@@ -274,15 +293,15 @@ func (m *PollingEvent) GetMeta() *Meta { ...@@ -274,15 +293,15 @@ func (m *PollingEvent) GetMeta() *Meta {
// 更新跨链事件索引 // 更新跨链事件索引
type UpdateIndex struct { type UpdateIndex struct {
//当前链已经处理到的位置 // 当前链已经处理到的位置
SequenceNum uint64 `protobuf:"varint,1,opt,name=sequenceNum,proto3" json:"sequenceNum,omitempty"` SequenceNum uint64 `protobuf:"varint,1,opt,name=sequenceNum,proto3" json:"sequenceNum,omitempty"`
//目的链服务ID,固定格式0x000001 // 目的链服务ID,固定格式0x000001
DstServiceID string `protobuf:"bytes,2,opt,name=dstServiceID,proto3" json:"dstServiceID,omitempty"` DstServiceID string `protobuf:"bytes,2,opt,name=dstServiceID,proto3" json:"dstServiceID,omitempty"`
//源链ID,固定格式0x000002 // 源链ID,固定格式0x000002
SrcServiceID string `protobuf:"bytes,3,opt,name=srcServiceID,proto3" json:"srcServiceID,omitempty"` SrcServiceID string `protobuf:"bytes,3,opt,name=srcServiceID,proto3" json:"srcServiceID,omitempty"`
//请求类型 0表示信息流入 1表示信息流出 2表示回滚 // 请求类型 0表示信息流入 1表示信息流出 2表示回滚
ReqType uint64 `protobuf:"varint,4,opt,name=reqType,proto3" json:"reqType,omitempty"` ReqType uint64 `protobuf:"varint,4,opt,name=reqType,proto3" json:"reqType,omitempty"`
//响应信息 // 响应信息
Response *Response `protobuf:"bytes,5,opt,name=response,proto3" json:"response,omitempty"` Response *Response `protobuf:"bytes,5,opt,name=response,proto3" json:"response,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
...@@ -299,15 +318,19 @@ func (*UpdateIndex) Descriptor() ([]byte, []int) { ...@@ -299,15 +318,19 @@ func (*UpdateIndex) Descriptor() ([]byte, []int) {
func (m *UpdateIndex) XXX_Unmarshal(b []byte) error { func (m *UpdateIndex) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_UpdateIndex.Unmarshal(m, b) return xxx_messageInfo_UpdateIndex.Unmarshal(m, b)
} }
func (m *UpdateIndex) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *UpdateIndex) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_UpdateIndex.Marshal(b, m, deterministic) return xxx_messageInfo_UpdateIndex.Marshal(b, m, deterministic)
} }
func (m *UpdateIndex) XXX_Merge(src proto.Message) { func (m *UpdateIndex) XXX_Merge(src proto.Message) {
xxx_messageInfo_UpdateIndex.Merge(m, src) xxx_messageInfo_UpdateIndex.Merge(m, src)
} }
func (m *UpdateIndex) XXX_Size() int { func (m *UpdateIndex) XXX_Size() int {
return xxx_messageInfo_UpdateIndex.Size(m) return xxx_messageInfo_UpdateIndex.Size(m)
} }
func (m *UpdateIndex) XXX_DiscardUnknown() { func (m *UpdateIndex) XXX_DiscardUnknown() {
xxx_messageInfo_UpdateIndex.DiscardUnknown(m) xxx_messageInfo_UpdateIndex.DiscardUnknown(m)
} }
...@@ -351,19 +374,19 @@ func (m *UpdateIndex) GetResponse() *Response { ...@@ -351,19 +374,19 @@ func (m *UpdateIndex) GetResponse() *Response {
// 跨链事件 // 跨链事件
type InterchainEvent struct { type InterchainEvent struct {
//索引值,这个有系统自动生成 // 索引值,这个有系统自动生成
Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
//目的链ID,固定格式0x000001 // 目的链ID,固定格式0x000001
DstServiceID string `protobuf:"bytes,2,opt,name=dstServiceID,proto3" json:"dstServiceID,omitempty"` DstServiceID string `protobuf:"bytes,2,opt,name=dstServiceID,proto3" json:"dstServiceID,omitempty"`
//源链ID,固定格式0x000002 // 源链ID,固定格式0x000002
SrcServiceID string `protobuf:"bytes,3,opt,name=srcServiceID,proto3" json:"srcServiceID,omitempty"` SrcServiceID string `protobuf:"bytes,3,opt,name=srcServiceID,proto3" json:"srcServiceID,omitempty"`
//跨链交易类型 0表示storage,1表示coins,2表示token...... // 跨链交易类型 0表示storage,1表示coins,2表示token......
Type uint64 `protobuf:"varint,4,opt,name=type,proto3" json:"type,omitempty"` Type uint64 `protobuf:"varint,4,opt,name=type,proto3" json:"type,omitempty"`
//调用方法 // 调用方法
Func string `protobuf:"bytes,5,opt,name=func,proto3" json:"func,omitempty"` Func string `protobuf:"bytes,5,opt,name=func,proto3" json:"func,omitempty"`
//参数列表 // 参数列表
Args []string `protobuf:"bytes,6,rep,name=args,proto3" json:"args,omitempty"` Args []string `protobuf:"bytes,6,rep,name=args,proto3" json:"args,omitempty"`
//状态 0表示开始处理 1表示跨链成功 2表示跨链失败 // 状态 0表示开始处理 1表示跨链成功 2表示跨链失败
Status int32 `protobuf:"varint,7,opt,name=status,proto3" json:"status,omitempty"` Status int32 `protobuf:"varint,7,opt,name=status,proto3" json:"status,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
...@@ -380,15 +403,19 @@ func (*InterchainEvent) Descriptor() ([]byte, []int) { ...@@ -380,15 +403,19 @@ func (*InterchainEvent) Descriptor() ([]byte, []int) {
func (m *InterchainEvent) XXX_Unmarshal(b []byte) error { func (m *InterchainEvent) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_InterchainEvent.Unmarshal(m, b) return xxx_messageInfo_InterchainEvent.Unmarshal(m, b)
} }
func (m *InterchainEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *InterchainEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_InterchainEvent.Marshal(b, m, deterministic) return xxx_messageInfo_InterchainEvent.Marshal(b, m, deterministic)
} }
func (m *InterchainEvent) XXX_Merge(src proto.Message) { func (m *InterchainEvent) XXX_Merge(src proto.Message) {
xxx_messageInfo_InterchainEvent.Merge(m, src) xxx_messageInfo_InterchainEvent.Merge(m, src)
} }
func (m *InterchainEvent) XXX_Size() int { func (m *InterchainEvent) XXX_Size() int {
return xxx_messageInfo_InterchainEvent.Size(m) return xxx_messageInfo_InterchainEvent.Size(m)
} }
func (m *InterchainEvent) XXX_DiscardUnknown() { func (m *InterchainEvent) XXX_DiscardUnknown() {
xxx_messageInfo_InterchainEvent.DiscardUnknown(m) xxx_messageInfo_InterchainEvent.DiscardUnknown(m)
} }
...@@ -444,7 +471,7 @@ func (m *InterchainEvent) GetStatus() int32 { ...@@ -444,7 +471,7 @@ func (m *InterchainEvent) GetStatus() int32 {
return 0 return 0
} }
//ReceiptBrokerLog // ReceiptBrokerLog
type ReceiptBrokerLog struct { type ReceiptBrokerLog struct {
// Types that are valid to be assigned to Value: // Types that are valid to be assigned to Value:
// *ReceiptBrokerLog_Register // *ReceiptBrokerLog_Register
...@@ -468,15 +495,19 @@ func (*ReceiptBrokerLog) Descriptor() ([]byte, []int) { ...@@ -468,15 +495,19 @@ func (*ReceiptBrokerLog) Descriptor() ([]byte, []int) {
func (m *ReceiptBrokerLog) XXX_Unmarshal(b []byte) error { func (m *ReceiptBrokerLog) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReceiptBrokerLog.Unmarshal(m, b) return xxx_messageInfo_ReceiptBrokerLog.Unmarshal(m, b)
} }
func (m *ReceiptBrokerLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *ReceiptBrokerLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReceiptBrokerLog.Marshal(b, m, deterministic) return xxx_messageInfo_ReceiptBrokerLog.Marshal(b, m, deterministic)
} }
func (m *ReceiptBrokerLog) XXX_Merge(src proto.Message) { func (m *ReceiptBrokerLog) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReceiptBrokerLog.Merge(m, src) xxx_messageInfo_ReceiptBrokerLog.Merge(m, src)
} }
func (m *ReceiptBrokerLog) XXX_Size() int { func (m *ReceiptBrokerLog) XXX_Size() int {
return xxx_messageInfo_ReceiptBrokerLog.Size(m) return xxx_messageInfo_ReceiptBrokerLog.Size(m)
} }
func (m *ReceiptBrokerLog) XXX_DiscardUnknown() { func (m *ReceiptBrokerLog) XXX_DiscardUnknown() {
xxx_messageInfo_ReceiptBrokerLog.DiscardUnknown(m) xxx_messageInfo_ReceiptBrokerLog.DiscardUnknown(m)
} }
...@@ -563,12 +594,12 @@ func (*ReceiptBrokerLog) XXX_OneofWrappers() []interface{} { ...@@ -563,12 +594,12 @@ func (*ReceiptBrokerLog) XXX_OneofWrappers() []interface{} {
} }
} }
//查询跨出事件 // 查询跨出事件
type QueryInterchainEvent struct { type QueryInterchainEvent struct {
Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
//目的链ID,固定格式0x000001 // 目的链ID,固定格式0x000001
DstServiceID string `protobuf:"bytes,2,opt,name=dstServiceID,proto3" json:"dstServiceID,omitempty"` DstServiceID string `protobuf:"bytes,2,opt,name=dstServiceID,proto3" json:"dstServiceID,omitempty"`
//源链ID,固定格式0x000002 // 源链ID,固定格式0x000002
SrcServiceID string `protobuf:"bytes,3,opt,name=srcServiceID,proto3" json:"srcServiceID,omitempty"` SrcServiceID string `protobuf:"bytes,3,opt,name=srcServiceID,proto3" json:"srcServiceID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
...@@ -585,15 +616,19 @@ func (*QueryInterchainEvent) Descriptor() ([]byte, []int) { ...@@ -585,15 +616,19 @@ func (*QueryInterchainEvent) Descriptor() ([]byte, []int) {
func (m *QueryInterchainEvent) XXX_Unmarshal(b []byte) error { func (m *QueryInterchainEvent) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_QueryInterchainEvent.Unmarshal(m, b) return xxx_messageInfo_QueryInterchainEvent.Unmarshal(m, b)
} }
func (m *QueryInterchainEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *QueryInterchainEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_QueryInterchainEvent.Marshal(b, m, deterministic) return xxx_messageInfo_QueryInterchainEvent.Marshal(b, m, deterministic)
} }
func (m *QueryInterchainEvent) XXX_Merge(src proto.Message) { func (m *QueryInterchainEvent) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryInterchainEvent.Merge(m, src) xxx_messageInfo_QueryInterchainEvent.Merge(m, src)
} }
func (m *QueryInterchainEvent) XXX_Size() int { func (m *QueryInterchainEvent) XXX_Size() int {
return xxx_messageInfo_QueryInterchainEvent.Size(m) return xxx_messageInfo_QueryInterchainEvent.Size(m)
} }
func (m *QueryInterchainEvent) XXX_DiscardUnknown() { func (m *QueryInterchainEvent) XXX_DiscardUnknown() {
xxx_messageInfo_QueryInterchainEvent.DiscardUnknown(m) xxx_messageInfo_QueryInterchainEvent.DiscardUnknown(m)
} }
...@@ -621,7 +656,7 @@ func (m *QueryInterchainEvent) GetSrcServiceID() string { ...@@ -621,7 +656,7 @@ func (m *QueryInterchainEvent) GetSrcServiceID() string {
return "" return ""
} }
//跨链事件列表 // 跨链事件列表
type InterChainEventList struct { type InterChainEventList struct {
List []*InterchainEvent `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` List []*InterchainEvent `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
...@@ -639,15 +674,19 @@ func (*InterChainEventList) Descriptor() ([]byte, []int) { ...@@ -639,15 +674,19 @@ func (*InterChainEventList) Descriptor() ([]byte, []int) {
func (m *InterChainEventList) XXX_Unmarshal(b []byte) error { func (m *InterChainEventList) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_InterChainEventList.Unmarshal(m, b) return xxx_messageInfo_InterChainEventList.Unmarshal(m, b)
} }
func (m *InterChainEventList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *InterChainEventList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_InterChainEventList.Marshal(b, m, deterministic) return xxx_messageInfo_InterChainEventList.Marshal(b, m, deterministic)
} }
func (m *InterChainEventList) XXX_Merge(src proto.Message) { func (m *InterChainEventList) XXX_Merge(src proto.Message) {
xxx_messageInfo_InterChainEventList.Merge(m, src) xxx_messageInfo_InterChainEventList.Merge(m, src)
} }
func (m *InterChainEventList) XXX_Size() int { func (m *InterChainEventList) XXX_Size() int {
return xxx_messageInfo_InterChainEventList.Size(m) return xxx_messageInfo_InterChainEventList.Size(m)
} }
func (m *InterChainEventList) XXX_DiscardUnknown() { func (m *InterChainEventList) XXX_DiscardUnknown() {
xxx_messageInfo_InterChainEventList.DiscardUnknown(m) xxx_messageInfo_InterChainEventList.DiscardUnknown(m)
} }
...@@ -693,15 +732,19 @@ func (*QueryOutterMeta) Descriptor() ([]byte, []int) { ...@@ -693,15 +732,19 @@ func (*QueryOutterMeta) Descriptor() ([]byte, []int) {
func (m *QueryOutterMeta) XXX_Unmarshal(b []byte) error { func (m *QueryOutterMeta) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_QueryOutterMeta.Unmarshal(m, b) return xxx_messageInfo_QueryOutterMeta.Unmarshal(m, b)
} }
func (m *QueryOutterMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *QueryOutterMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_QueryOutterMeta.Marshal(b, m, deterministic) return xxx_messageInfo_QueryOutterMeta.Marshal(b, m, deterministic)
} }
func (m *QueryOutterMeta) XXX_Merge(src proto.Message) { func (m *QueryOutterMeta) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryOutterMeta.Merge(m, src) xxx_messageInfo_QueryOutterMeta.Merge(m, src)
} }
func (m *QueryOutterMeta) XXX_Size() int { func (m *QueryOutterMeta) XXX_Size() int {
return xxx_messageInfo_QueryOutterMeta.Size(m) return xxx_messageInfo_QueryOutterMeta.Size(m)
} }
func (m *QueryOutterMeta) XXX_DiscardUnknown() { func (m *QueryOutterMeta) XXX_DiscardUnknown() {
xxx_messageInfo_QueryOutterMeta.DiscardUnknown(m) xxx_messageInfo_QueryOutterMeta.DiscardUnknown(m)
} }
...@@ -724,15 +767,19 @@ func (*QueryInnerMeta) Descriptor() ([]byte, []int) { ...@@ -724,15 +767,19 @@ func (*QueryInnerMeta) Descriptor() ([]byte, []int) {
func (m *QueryInnerMeta) XXX_Unmarshal(b []byte) error { func (m *QueryInnerMeta) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_QueryInnerMeta.Unmarshal(m, b) return xxx_messageInfo_QueryInnerMeta.Unmarshal(m, b)
} }
func (m *QueryInnerMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *QueryInnerMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_QueryInnerMeta.Marshal(b, m, deterministic) return xxx_messageInfo_QueryInnerMeta.Marshal(b, m, deterministic)
} }
func (m *QueryInnerMeta) XXX_Merge(src proto.Message) { func (m *QueryInnerMeta) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryInnerMeta.Merge(m, src) xxx_messageInfo_QueryInnerMeta.Merge(m, src)
} }
func (m *QueryInnerMeta) XXX_Size() int { func (m *QueryInnerMeta) XXX_Size() int {
return xxx_messageInfo_QueryInnerMeta.Size(m) return xxx_messageInfo_QueryInnerMeta.Size(m)
} }
func (m *QueryInnerMeta) XXX_DiscardUnknown() { func (m *QueryInnerMeta) XXX_DiscardUnknown() {
xxx_messageInfo_QueryInnerMeta.DiscardUnknown(m) xxx_messageInfo_QueryInnerMeta.DiscardUnknown(m)
} }
...@@ -755,15 +802,19 @@ func (*QueryNilParam) Descriptor() ([]byte, []int) { ...@@ -755,15 +802,19 @@ func (*QueryNilParam) Descriptor() ([]byte, []int) {
func (m *QueryNilParam) XXX_Unmarshal(b []byte) error { func (m *QueryNilParam) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_QueryNilParam.Unmarshal(m, b) return xxx_messageInfo_QueryNilParam.Unmarshal(m, b)
} }
func (m *QueryNilParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *QueryNilParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_QueryNilParam.Marshal(b, m, deterministic) return xxx_messageInfo_QueryNilParam.Marshal(b, m, deterministic)
} }
func (m *QueryNilParam) XXX_Merge(src proto.Message) { func (m *QueryNilParam) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryNilParam.Merge(m, src) xxx_messageInfo_QueryNilParam.Merge(m, src)
} }
func (m *QueryNilParam) XXX_Size() int { func (m *QueryNilParam) XXX_Size() int {
return xxx_messageInfo_QueryNilParam.Size(m) return xxx_messageInfo_QueryNilParam.Size(m)
} }
func (m *QueryNilParam) XXX_DiscardUnknown() { func (m *QueryNilParam) XXX_DiscardUnknown() {
xxx_messageInfo_QueryNilParam.DiscardUnknown(m) xxx_messageInfo_QueryNilParam.DiscardUnknown(m)
} }
...@@ -788,15 +839,19 @@ func (*QueryInMessage) Descriptor() ([]byte, []int) { ...@@ -788,15 +839,19 @@ func (*QueryInMessage) Descriptor() ([]byte, []int) {
func (m *QueryInMessage) XXX_Unmarshal(b []byte) error { func (m *QueryInMessage) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_QueryInMessage.Unmarshal(m, b) return xxx_messageInfo_QueryInMessage.Unmarshal(m, b)
} }
func (m *QueryInMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *QueryInMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_QueryInMessage.Marshal(b, m, deterministic) return xxx_messageInfo_QueryInMessage.Marshal(b, m, deterministic)
} }
func (m *QueryInMessage) XXX_Merge(src proto.Message) { func (m *QueryInMessage) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryInMessage.Merge(m, src) xxx_messageInfo_QueryInMessage.Merge(m, src)
} }
func (m *QueryInMessage) XXX_Size() int { func (m *QueryInMessage) XXX_Size() int {
return xxx_messageInfo_QueryInMessage.Size(m) return xxx_messageInfo_QueryInMessage.Size(m)
} }
func (m *QueryInMessage) XXX_DiscardUnknown() { func (m *QueryInMessage) XXX_DiscardUnknown() {
xxx_messageInfo_QueryInMessage.DiscardUnknown(m) xxx_messageInfo_QueryInMessage.DiscardUnknown(m)
} }
...@@ -835,15 +890,19 @@ func (*QueryOutMessage) Descriptor() ([]byte, []int) { ...@@ -835,15 +890,19 @@ func (*QueryOutMessage) Descriptor() ([]byte, []int) {
func (m *QueryOutMessage) XXX_Unmarshal(b []byte) error { func (m *QueryOutMessage) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_QueryOutMessage.Unmarshal(m, b) return xxx_messageInfo_QueryOutMessage.Unmarshal(m, b)
} }
func (m *QueryOutMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *QueryOutMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_QueryOutMessage.Marshal(b, m, deterministic) return xxx_messageInfo_QueryOutMessage.Marshal(b, m, deterministic)
} }
func (m *QueryOutMessage) XXX_Merge(src proto.Message) { func (m *QueryOutMessage) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryOutMessage.Merge(m, src) xxx_messageInfo_QueryOutMessage.Merge(m, src)
} }
func (m *QueryOutMessage) XXX_Size() int { func (m *QueryOutMessage) XXX_Size() int {
return xxx_messageInfo_QueryOutMessage.Size(m) return xxx_messageInfo_QueryOutMessage.Size(m)
} }
func (m *QueryOutMessage) XXX_DiscardUnknown() { func (m *QueryOutMessage) XXX_DiscardUnknown() {
xxx_messageInfo_QueryOutMessage.DiscardUnknown(m) xxx_messageInfo_QueryOutMessage.DiscardUnknown(m)
} }
...@@ -881,15 +940,19 @@ func (*Meta) Descriptor() ([]byte, []int) { ...@@ -881,15 +940,19 @@ func (*Meta) Descriptor() ([]byte, []int) {
func (m *Meta) XXX_Unmarshal(b []byte) error { func (m *Meta) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Meta.Unmarshal(m, b) return xxx_messageInfo_Meta.Unmarshal(m, b)
} }
func (m *Meta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *Meta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Meta.Marshal(b, m, deterministic) return xxx_messageInfo_Meta.Marshal(b, m, deterministic)
} }
func (m *Meta) XXX_Merge(src proto.Message) { func (m *Meta) XXX_Merge(src proto.Message) {
xxx_messageInfo_Meta.Merge(m, src) xxx_messageInfo_Meta.Merge(m, src)
} }
func (m *Meta) XXX_Size() int { func (m *Meta) XXX_Size() int {
return xxx_messageInfo_Meta.Size(m) return xxx_messageInfo_Meta.Size(m)
} }
func (m *Meta) XXX_DiscardUnknown() { func (m *Meta) XXX_DiscardUnknown() {
xxx_messageInfo_Meta.DiscardUnknown(m) xxx_messageInfo_Meta.DiscardUnknown(m)
} }
...@@ -904,9 +967,9 @@ func (m *Meta) GetMeta() map[string]uint64 { ...@@ -904,9 +967,9 @@ func (m *Meta) GetMeta() map[string]uint64 {
} }
type BrokerInfo struct { type BrokerInfo struct {
//跨链协议版本ID // 跨链协议版本ID
BxhId string `protobuf:"bytes,1,opt,name=bxhId,proto3" json:"bxhId,omitempty"` BxhId string `protobuf:"bytes,1,opt,name=bxhId,proto3" json:"bxhId,omitempty"`
//应用链ID // 应用链ID
AppChainId string `protobuf:"bytes,2,opt,name=appChainId,proto3" json:"appChainId,omitempty"` AppChainId string `protobuf:"bytes,2,opt,name=appChainId,proto3" json:"appChainId,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
...@@ -923,15 +986,19 @@ func (*BrokerInfo) Descriptor() ([]byte, []int) { ...@@ -923,15 +986,19 @@ func (*BrokerInfo) Descriptor() ([]byte, []int) {
func (m *BrokerInfo) XXX_Unmarshal(b []byte) error { func (m *BrokerInfo) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BrokerInfo.Unmarshal(m, b) return xxx_messageInfo_BrokerInfo.Unmarshal(m, b)
} }
func (m *BrokerInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *BrokerInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BrokerInfo.Marshal(b, m, deterministic) return xxx_messageInfo_BrokerInfo.Marshal(b, m, deterministic)
} }
func (m *BrokerInfo) XXX_Merge(src proto.Message) { func (m *BrokerInfo) XXX_Merge(src proto.Message) {
xxx_messageInfo_BrokerInfo.Merge(m, src) xxx_messageInfo_BrokerInfo.Merge(m, src)
} }
func (m *BrokerInfo) XXX_Size() int { func (m *BrokerInfo) XXX_Size() int {
return xxx_messageInfo_BrokerInfo.Size(m) return xxx_messageInfo_BrokerInfo.Size(m)
} }
func (m *BrokerInfo) XXX_DiscardUnknown() { func (m *BrokerInfo) XXX_DiscardUnknown() {
xxx_messageInfo_BrokerInfo.DiscardUnknown(m) xxx_messageInfo_BrokerInfo.DiscardUnknown(m)
} }
...@@ -974,15 +1041,19 @@ func (*Response) Descriptor() ([]byte, []int) { ...@@ -974,15 +1041,19 @@ func (*Response) Descriptor() ([]byte, []int) {
func (m *Response) XXX_Unmarshal(b []byte) error { func (m *Response) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Response.Unmarshal(m, b) return xxx_messageInfo_Response.Unmarshal(m, b)
} }
func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Response.Marshal(b, m, deterministic) return xxx_messageInfo_Response.Marshal(b, m, deterministic)
} }
func (m *Response) XXX_Merge(src proto.Message) { func (m *Response) XXX_Merge(src proto.Message) {
xxx_messageInfo_Response.Merge(m, src) xxx_messageInfo_Response.Merge(m, src)
} }
func (m *Response) XXX_Size() int { func (m *Response) XXX_Size() int {
return xxx_messageInfo_Response.Size(m) return xxx_messageInfo_Response.Size(m)
} }
func (m *Response) XXX_DiscardUnknown() { func (m *Response) XXX_DiscardUnknown() {
xxx_messageInfo_Response.DiscardUnknown(m) xxx_messageInfo_Response.DiscardUnknown(m)
} }
...@@ -1082,8 +1153,10 @@ var fileDescriptor_f209535e190f2bed = []byte{ ...@@ -1082,8 +1153,10 @@ var fileDescriptor_f209535e190f2bed = []byte{
} }
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
var _ context.Context var (
var _ grpc.ClientConnInterface _ context.Context
_ grpc.ClientConnInterface
)
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against. // is compatible with the grpc package it is being compiled against.
...@@ -1092,8 +1165,7 @@ const _ = grpc.SupportPackageIsVersion6 ...@@ -1092,8 +1165,7 @@ const _ = grpc.SupportPackageIsVersion6
// BrokerClient is the client API for Broker service. // BrokerClient is the client API for Broker service.
// //
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type BrokerClient interface { type BrokerClient interface{}
}
type brokerClient struct { type brokerClient struct {
cc grpc.ClientConnInterface cc grpc.ClientConnInterface
...@@ -1104,12 +1176,10 @@ func NewBrokerClient(cc grpc.ClientConnInterface) BrokerClient { ...@@ -1104,12 +1176,10 @@ func NewBrokerClient(cc grpc.ClientConnInterface) BrokerClient {
} }
// BrokerServer is the server API for Broker service. // BrokerServer is the server API for Broker service.
type BrokerServer interface { type BrokerServer interface{}
}
// UnimplementedBrokerServer can be embedded to have forward compatible implementations. // UnimplementedBrokerServer can be embedded to have forward compatible implementations.
type UnimplementedBrokerServer struct { type UnimplementedBrokerServer struct{}
}
func RegisterBrokerServer(s *grpc.Server, srv BrokerServer) { func RegisterBrokerServer(s *grpc.Server, srv BrokerServer) {
s.RegisterService(&_Broker_serviceDesc, srv) s.RegisterService(&_Broker_serviceDesc, srv)
......
...@@ -5,14 +5,17 @@ package types ...@@ -5,14 +5,17 @@ package types
import ( import (
fmt "fmt" fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math" math "math"
proto "github.com/golang/protobuf/proto"
) )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal var (
var _ = fmt.Errorf _ = proto.Marshal
var _ = math.Inf _ = fmt.Errorf
_ = math.Inf
)
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
...@@ -43,15 +46,19 @@ func (*CertAction) Descriptor() ([]byte, []int) { ...@@ -43,15 +46,19 @@ func (*CertAction) Descriptor() ([]byte, []int) {
func (m *CertAction) XXX_Unmarshal(b []byte) error { func (m *CertAction) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CertAction.Unmarshal(m, b) return xxx_messageInfo_CertAction.Unmarshal(m, b)
} }
func (m *CertAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *CertAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CertAction.Marshal(b, m, deterministic) return xxx_messageInfo_CertAction.Marshal(b, m, deterministic)
} }
func (m *CertAction) XXX_Merge(src proto.Message) { func (m *CertAction) XXX_Merge(src proto.Message) {
xxx_messageInfo_CertAction.Merge(m, src) xxx_messageInfo_CertAction.Merge(m, src)
} }
func (m *CertAction) XXX_Size() int { func (m *CertAction) XXX_Size() int {
return xxx_messageInfo_CertAction.Size(m) return xxx_messageInfo_CertAction.Size(m)
} }
func (m *CertAction) XXX_DiscardUnknown() { func (m *CertAction) XXX_DiscardUnknown() {
xxx_messageInfo_CertAction.DiscardUnknown(m) xxx_messageInfo_CertAction.DiscardUnknown(m)
} }
...@@ -143,15 +150,19 @@ func (*CertNew) Descriptor() ([]byte, []int) { ...@@ -143,15 +150,19 @@ func (*CertNew) Descriptor() ([]byte, []int) {
func (m *CertNew) XXX_Unmarshal(b []byte) error { func (m *CertNew) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CertNew.Unmarshal(m, b) return xxx_messageInfo_CertNew.Unmarshal(m, b)
} }
func (m *CertNew) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *CertNew) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CertNew.Marshal(b, m, deterministic) return xxx_messageInfo_CertNew.Marshal(b, m, deterministic)
} }
func (m *CertNew) XXX_Merge(src proto.Message) { func (m *CertNew) XXX_Merge(src proto.Message) {
xxx_messageInfo_CertNew.Merge(m, src) xxx_messageInfo_CertNew.Merge(m, src)
} }
func (m *CertNew) XXX_Size() int { func (m *CertNew) XXX_Size() int {
return xxx_messageInfo_CertNew.Size(m) return xxx_messageInfo_CertNew.Size(m)
} }
func (m *CertNew) XXX_DiscardUnknown() { func (m *CertNew) XXX_DiscardUnknown() {
xxx_messageInfo_CertNew.DiscardUnknown(m) xxx_messageInfo_CertNew.DiscardUnknown(m)
} }
...@@ -191,15 +202,19 @@ func (*CertUpdate) Descriptor() ([]byte, []int) { ...@@ -191,15 +202,19 @@ func (*CertUpdate) Descriptor() ([]byte, []int) {
func (m *CertUpdate) XXX_Unmarshal(b []byte) error { func (m *CertUpdate) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CertUpdate.Unmarshal(m, b) return xxx_messageInfo_CertUpdate.Unmarshal(m, b)
} }
func (m *CertUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *CertUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CertUpdate.Marshal(b, m, deterministic) return xxx_messageInfo_CertUpdate.Marshal(b, m, deterministic)
} }
func (m *CertUpdate) XXX_Merge(src proto.Message) { func (m *CertUpdate) XXX_Merge(src proto.Message) {
xxx_messageInfo_CertUpdate.Merge(m, src) xxx_messageInfo_CertUpdate.Merge(m, src)
} }
func (m *CertUpdate) XXX_Size() int { func (m *CertUpdate) XXX_Size() int {
return xxx_messageInfo_CertUpdate.Size(m) return xxx_messageInfo_CertUpdate.Size(m)
} }
func (m *CertUpdate) XXX_DiscardUnknown() { func (m *CertUpdate) XXX_DiscardUnknown() {
xxx_messageInfo_CertUpdate.DiscardUnknown(m) xxx_messageInfo_CertUpdate.DiscardUnknown(m)
} }
...@@ -239,15 +254,19 @@ func (*CertNormal) Descriptor() ([]byte, []int) { ...@@ -239,15 +254,19 @@ func (*CertNormal) Descriptor() ([]byte, []int) {
func (m *CertNormal) XXX_Unmarshal(b []byte) error { func (m *CertNormal) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CertNormal.Unmarshal(m, b) return xxx_messageInfo_CertNormal.Unmarshal(m, b)
} }
func (m *CertNormal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *CertNormal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CertNormal.Marshal(b, m, deterministic) return xxx_messageInfo_CertNormal.Marshal(b, m, deterministic)
} }
func (m *CertNormal) XXX_Merge(src proto.Message) { func (m *CertNormal) XXX_Merge(src proto.Message) {
xxx_messageInfo_CertNormal.Merge(m, src) xxx_messageInfo_CertNormal.Merge(m, src)
} }
func (m *CertNormal) XXX_Size() int { func (m *CertNormal) XXX_Size() int {
return xxx_messageInfo_CertNormal.Size(m) return xxx_messageInfo_CertNormal.Size(m)
} }
func (m *CertNormal) XXX_DiscardUnknown() { func (m *CertNormal) XXX_DiscardUnknown() {
xxx_messageInfo_CertNormal.DiscardUnknown(m) xxx_messageInfo_CertNormal.DiscardUnknown(m)
} }
...@@ -287,15 +306,19 @@ func (*CertSignature) Descriptor() ([]byte, []int) { ...@@ -287,15 +306,19 @@ func (*CertSignature) Descriptor() ([]byte, []int) {
func (m *CertSignature) XXX_Unmarshal(b []byte) error { func (m *CertSignature) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CertSignature.Unmarshal(m, b) return xxx_messageInfo_CertSignature.Unmarshal(m, b)
} }
func (m *CertSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *CertSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CertSignature.Marshal(b, m, deterministic) return xxx_messageInfo_CertSignature.Marshal(b, m, deterministic)
} }
func (m *CertSignature) XXX_Merge(src proto.Message) { func (m *CertSignature) XXX_Merge(src proto.Message) {
xxx_messageInfo_CertSignature.Merge(m, src) xxx_messageInfo_CertSignature.Merge(m, src)
} }
func (m *CertSignature) XXX_Size() int { func (m *CertSignature) XXX_Size() int {
return xxx_messageInfo_CertSignature.Size(m) return xxx_messageInfo_CertSignature.Size(m)
} }
func (m *CertSignature) XXX_DiscardUnknown() { func (m *CertSignature) XXX_DiscardUnknown() {
xxx_messageInfo_CertSignature.DiscardUnknown(m) xxx_messageInfo_CertSignature.DiscardUnknown(m)
} }
......
...@@ -5,14 +5,17 @@ package types ...@@ -5,14 +5,17 @@ package types
import ( import (
fmt "fmt" fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math" math "math"
proto "github.com/golang/protobuf/proto"
) )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal var (
var _ = fmt.Errorf _ = proto.Marshal
var _ = math.Inf _ = fmt.Errorf
_ = math.Inf
)
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
...@@ -38,15 +41,19 @@ func (*Reply) Descriptor() ([]byte, []int) { ...@@ -38,15 +41,19 @@ func (*Reply) Descriptor() ([]byte, []int) {
func (m *Reply) XXX_Unmarshal(b []byte) error { func (m *Reply) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Reply.Unmarshal(m, b) return xxx_messageInfo_Reply.Unmarshal(m, b)
} }
func (m *Reply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *Reply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Reply.Marshal(b, m, deterministic) return xxx_messageInfo_Reply.Marshal(b, m, deterministic)
} }
func (m *Reply) XXX_Merge(src proto.Message) { func (m *Reply) XXX_Merge(src proto.Message) {
xxx_messageInfo_Reply.Merge(m, src) xxx_messageInfo_Reply.Merge(m, src)
} }
func (m *Reply) XXX_Size() int { func (m *Reply) XXX_Size() int {
return xxx_messageInfo_Reply.Size(m) return xxx_messageInfo_Reply.Size(m)
} }
func (m *Reply) XXX_DiscardUnknown() { func (m *Reply) XXX_DiscardUnknown() {
xxx_messageInfo_Reply.DiscardUnknown(m) xxx_messageInfo_Reply.DiscardUnknown(m)
} }
...@@ -84,15 +91,19 @@ func (*ReqString) Descriptor() ([]byte, []int) { ...@@ -84,15 +91,19 @@ func (*ReqString) Descriptor() ([]byte, []int) {
func (m *ReqString) XXX_Unmarshal(b []byte) error { func (m *ReqString) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReqString.Unmarshal(m, b) return xxx_messageInfo_ReqString.Unmarshal(m, b)
} }
func (m *ReqString) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *ReqString) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReqString.Marshal(b, m, deterministic) return xxx_messageInfo_ReqString.Marshal(b, m, deterministic)
} }
func (m *ReqString) XXX_Merge(src proto.Message) { func (m *ReqString) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReqString.Merge(m, src) xxx_messageInfo_ReqString.Merge(m, src)
} }
func (m *ReqString) XXX_Size() int { func (m *ReqString) XXX_Size() int {
return xxx_messageInfo_ReqString.Size(m) return xxx_messageInfo_ReqString.Size(m)
} }
func (m *ReqString) XXX_DiscardUnknown() { func (m *ReqString) XXX_DiscardUnknown() {
xxx_messageInfo_ReqString.DiscardUnknown(m) xxx_messageInfo_ReqString.DiscardUnknown(m)
} }
...@@ -123,15 +134,19 @@ func (*ReplyString) Descriptor() ([]byte, []int) { ...@@ -123,15 +134,19 @@ func (*ReplyString) Descriptor() ([]byte, []int) {
func (m *ReplyString) XXX_Unmarshal(b []byte) error { func (m *ReplyString) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReplyString.Unmarshal(m, b) return xxx_messageInfo_ReplyString.Unmarshal(m, b)
} }
func (m *ReplyString) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *ReplyString) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReplyString.Marshal(b, m, deterministic) return xxx_messageInfo_ReplyString.Marshal(b, m, deterministic)
} }
func (m *ReplyString) XXX_Merge(src proto.Message) { func (m *ReplyString) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReplyString.Merge(m, src) xxx_messageInfo_ReplyString.Merge(m, src)
} }
func (m *ReplyString) XXX_Size() int { func (m *ReplyString) XXX_Size() int {
return xxx_messageInfo_ReplyString.Size(m) return xxx_messageInfo_ReplyString.Size(m)
} }
func (m *ReplyString) XXX_DiscardUnknown() { func (m *ReplyString) XXX_DiscardUnknown() {
xxx_messageInfo_ReplyString.DiscardUnknown(m) xxx_messageInfo_ReplyString.DiscardUnknown(m)
} }
...@@ -162,15 +177,19 @@ func (*ReplyStrings) Descriptor() ([]byte, []int) { ...@@ -162,15 +177,19 @@ func (*ReplyStrings) Descriptor() ([]byte, []int) {
func (m *ReplyStrings) XXX_Unmarshal(b []byte) error { func (m *ReplyStrings) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReplyStrings.Unmarshal(m, b) return xxx_messageInfo_ReplyStrings.Unmarshal(m, b)
} }
func (m *ReplyStrings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *ReplyStrings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReplyStrings.Marshal(b, m, deterministic) return xxx_messageInfo_ReplyStrings.Marshal(b, m, deterministic)
} }
func (m *ReplyStrings) XXX_Merge(src proto.Message) { func (m *ReplyStrings) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReplyStrings.Merge(m, src) xxx_messageInfo_ReplyStrings.Merge(m, src)
} }
func (m *ReplyStrings) XXX_Size() int { func (m *ReplyStrings) XXX_Size() int {
return xxx_messageInfo_ReplyStrings.Size(m) return xxx_messageInfo_ReplyStrings.Size(m)
} }
func (m *ReplyStrings) XXX_DiscardUnknown() { func (m *ReplyStrings) XXX_DiscardUnknown() {
xxx_messageInfo_ReplyStrings.DiscardUnknown(m) xxx_messageInfo_ReplyStrings.DiscardUnknown(m)
} }
...@@ -201,15 +220,19 @@ func (*ReqInt) Descriptor() ([]byte, []int) { ...@@ -201,15 +220,19 @@ func (*ReqInt) Descriptor() ([]byte, []int) {
func (m *ReqInt) XXX_Unmarshal(b []byte) error { func (m *ReqInt) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReqInt.Unmarshal(m, b) return xxx_messageInfo_ReqInt.Unmarshal(m, b)
} }
func (m *ReqInt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *ReqInt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReqInt.Marshal(b, m, deterministic) return xxx_messageInfo_ReqInt.Marshal(b, m, deterministic)
} }
func (m *ReqInt) XXX_Merge(src proto.Message) { func (m *ReqInt) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReqInt.Merge(m, src) xxx_messageInfo_ReqInt.Merge(m, src)
} }
func (m *ReqInt) XXX_Size() int { func (m *ReqInt) XXX_Size() int {
return xxx_messageInfo_ReqInt.Size(m) return xxx_messageInfo_ReqInt.Size(m)
} }
func (m *ReqInt) XXX_DiscardUnknown() { func (m *ReqInt) XXX_DiscardUnknown() {
xxx_messageInfo_ReqInt.DiscardUnknown(m) xxx_messageInfo_ReqInt.DiscardUnknown(m)
} }
...@@ -240,15 +263,19 @@ func (*Int64) Descriptor() ([]byte, []int) { ...@@ -240,15 +263,19 @@ func (*Int64) Descriptor() ([]byte, []int) {
func (m *Int64) XXX_Unmarshal(b []byte) error { func (m *Int64) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Int64.Unmarshal(m, b) return xxx_messageInfo_Int64.Unmarshal(m, b)
} }
func (m *Int64) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *Int64) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Int64.Marshal(b, m, deterministic) return xxx_messageInfo_Int64.Marshal(b, m, deterministic)
} }
func (m *Int64) XXX_Merge(src proto.Message) { func (m *Int64) XXX_Merge(src proto.Message) {
xxx_messageInfo_Int64.Merge(m, src) xxx_messageInfo_Int64.Merge(m, src)
} }
func (m *Int64) XXX_Size() int { func (m *Int64) XXX_Size() int {
return xxx_messageInfo_Int64.Size(m) return xxx_messageInfo_Int64.Size(m)
} }
func (m *Int64) XXX_DiscardUnknown() { func (m *Int64) XXX_DiscardUnknown() {
xxx_messageInfo_Int64.DiscardUnknown(m) xxx_messageInfo_Int64.DiscardUnknown(m)
} }
...@@ -280,15 +307,19 @@ func (*ReqHash) Descriptor() ([]byte, []int) { ...@@ -280,15 +307,19 @@ func (*ReqHash) Descriptor() ([]byte, []int) {
func (m *ReqHash) XXX_Unmarshal(b []byte) error { func (m *ReqHash) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReqHash.Unmarshal(m, b) return xxx_messageInfo_ReqHash.Unmarshal(m, b)
} }
func (m *ReqHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *ReqHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReqHash.Marshal(b, m, deterministic) return xxx_messageInfo_ReqHash.Marshal(b, m, deterministic)
} }
func (m *ReqHash) XXX_Merge(src proto.Message) { func (m *ReqHash) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReqHash.Merge(m, src) xxx_messageInfo_ReqHash.Merge(m, src)
} }
func (m *ReqHash) XXX_Size() int { func (m *ReqHash) XXX_Size() int {
return xxx_messageInfo_ReqHash.Size(m) return xxx_messageInfo_ReqHash.Size(m)
} }
func (m *ReqHash) XXX_DiscardUnknown() { func (m *ReqHash) XXX_DiscardUnknown() {
xxx_messageInfo_ReqHash.DiscardUnknown(m) xxx_messageInfo_ReqHash.DiscardUnknown(m)
} }
...@@ -326,15 +357,19 @@ func (*ReplyHash) Descriptor() ([]byte, []int) { ...@@ -326,15 +357,19 @@ func (*ReplyHash) Descriptor() ([]byte, []int) {
func (m *ReplyHash) XXX_Unmarshal(b []byte) error { func (m *ReplyHash) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReplyHash.Unmarshal(m, b) return xxx_messageInfo_ReplyHash.Unmarshal(m, b)
} }
func (m *ReplyHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *ReplyHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReplyHash.Marshal(b, m, deterministic) return xxx_messageInfo_ReplyHash.Marshal(b, m, deterministic)
} }
func (m *ReplyHash) XXX_Merge(src proto.Message) { func (m *ReplyHash) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReplyHash.Merge(m, src) xxx_messageInfo_ReplyHash.Merge(m, src)
} }
func (m *ReplyHash) XXX_Size() int { func (m *ReplyHash) XXX_Size() int {
return xxx_messageInfo_ReplyHash.Size(m) return xxx_messageInfo_ReplyHash.Size(m)
} }
func (m *ReplyHash) XXX_DiscardUnknown() { func (m *ReplyHash) XXX_DiscardUnknown() {
xxx_messageInfo_ReplyHash.DiscardUnknown(m) xxx_messageInfo_ReplyHash.DiscardUnknown(m)
} }
...@@ -364,15 +399,19 @@ func (*ReqNil) Descriptor() ([]byte, []int) { ...@@ -364,15 +399,19 @@ func (*ReqNil) Descriptor() ([]byte, []int) {
func (m *ReqNil) XXX_Unmarshal(b []byte) error { func (m *ReqNil) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReqNil.Unmarshal(m, b) return xxx_messageInfo_ReqNil.Unmarshal(m, b)
} }
func (m *ReqNil) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *ReqNil) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReqNil.Marshal(b, m, deterministic) return xxx_messageInfo_ReqNil.Marshal(b, m, deterministic)
} }
func (m *ReqNil) XXX_Merge(src proto.Message) { func (m *ReqNil) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReqNil.Merge(m, src) xxx_messageInfo_ReqNil.Merge(m, src)
} }
func (m *ReqNil) XXX_Size() int { func (m *ReqNil) XXX_Size() int {
return xxx_messageInfo_ReqNil.Size(m) return xxx_messageInfo_ReqNil.Size(m)
} }
func (m *ReqNil) XXX_DiscardUnknown() { func (m *ReqNil) XXX_DiscardUnknown() {
xxx_messageInfo_ReqNil.DiscardUnknown(m) xxx_messageInfo_ReqNil.DiscardUnknown(m)
} }
...@@ -396,15 +435,19 @@ func (*ReqHashes) Descriptor() ([]byte, []int) { ...@@ -396,15 +435,19 @@ func (*ReqHashes) Descriptor() ([]byte, []int) {
func (m *ReqHashes) XXX_Unmarshal(b []byte) error { func (m *ReqHashes) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReqHashes.Unmarshal(m, b) return xxx_messageInfo_ReqHashes.Unmarshal(m, b)
} }
func (m *ReqHashes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *ReqHashes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReqHashes.Marshal(b, m, deterministic) return xxx_messageInfo_ReqHashes.Marshal(b, m, deterministic)
} }
func (m *ReqHashes) XXX_Merge(src proto.Message) { func (m *ReqHashes) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReqHashes.Merge(m, src) xxx_messageInfo_ReqHashes.Merge(m, src)
} }
func (m *ReqHashes) XXX_Size() int { func (m *ReqHashes) XXX_Size() int {
return xxx_messageInfo_ReqHashes.Size(m) return xxx_messageInfo_ReqHashes.Size(m)
} }
func (m *ReqHashes) XXX_DiscardUnknown() { func (m *ReqHashes) XXX_DiscardUnknown() {
xxx_messageInfo_ReqHashes.DiscardUnknown(m) xxx_messageInfo_ReqHashes.DiscardUnknown(m)
} }
...@@ -435,15 +478,19 @@ func (*ReplyHashes) Descriptor() ([]byte, []int) { ...@@ -435,15 +478,19 @@ func (*ReplyHashes) Descriptor() ([]byte, []int) {
func (m *ReplyHashes) XXX_Unmarshal(b []byte) error { func (m *ReplyHashes) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReplyHashes.Unmarshal(m, b) return xxx_messageInfo_ReplyHashes.Unmarshal(m, b)
} }
func (m *ReplyHashes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *ReplyHashes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReplyHashes.Marshal(b, m, deterministic) return xxx_messageInfo_ReplyHashes.Marshal(b, m, deterministic)
} }
func (m *ReplyHashes) XXX_Merge(src proto.Message) { func (m *ReplyHashes) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReplyHashes.Merge(m, src) xxx_messageInfo_ReplyHashes.Merge(m, src)
} }
func (m *ReplyHashes) XXX_Size() int { func (m *ReplyHashes) XXX_Size() int {
return xxx_messageInfo_ReplyHashes.Size(m) return xxx_messageInfo_ReplyHashes.Size(m)
} }
func (m *ReplyHashes) XXX_DiscardUnknown() { func (m *ReplyHashes) XXX_DiscardUnknown() {
xxx_messageInfo_ReplyHashes.DiscardUnknown(m) xxx_messageInfo_ReplyHashes.DiscardUnknown(m)
} }
...@@ -475,15 +522,19 @@ func (*KeyValue) Descriptor() ([]byte, []int) { ...@@ -475,15 +522,19 @@ func (*KeyValue) Descriptor() ([]byte, []int) {
func (m *KeyValue) XXX_Unmarshal(b []byte) error { func (m *KeyValue) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_KeyValue.Unmarshal(m, b) return xxx_messageInfo_KeyValue.Unmarshal(m, b)
} }
func (m *KeyValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *KeyValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_KeyValue.Marshal(b, m, deterministic) return xxx_messageInfo_KeyValue.Marshal(b, m, deterministic)
} }
func (m *KeyValue) XXX_Merge(src proto.Message) { func (m *KeyValue) XXX_Merge(src proto.Message) {
xxx_messageInfo_KeyValue.Merge(m, src) xxx_messageInfo_KeyValue.Merge(m, src)
} }
func (m *KeyValue) XXX_Size() int { func (m *KeyValue) XXX_Size() int {
return xxx_messageInfo_KeyValue.Size(m) return xxx_messageInfo_KeyValue.Size(m)
} }
func (m *KeyValue) XXX_DiscardUnknown() { func (m *KeyValue) XXX_DiscardUnknown() {
xxx_messageInfo_KeyValue.DiscardUnknown(m) xxx_messageInfo_KeyValue.DiscardUnknown(m)
} }
...@@ -521,15 +572,19 @@ func (*TxHash) Descriptor() ([]byte, []int) { ...@@ -521,15 +572,19 @@ func (*TxHash) Descriptor() ([]byte, []int) {
func (m *TxHash) XXX_Unmarshal(b []byte) error { func (m *TxHash) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TxHash.Unmarshal(m, b) return xxx_messageInfo_TxHash.Unmarshal(m, b)
} }
func (m *TxHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *TxHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TxHash.Marshal(b, m, deterministic) return xxx_messageInfo_TxHash.Marshal(b, m, deterministic)
} }
func (m *TxHash) XXX_Merge(src proto.Message) { func (m *TxHash) XXX_Merge(src proto.Message) {
xxx_messageInfo_TxHash.Merge(m, src) xxx_messageInfo_TxHash.Merge(m, src)
} }
func (m *TxHash) XXX_Size() int { func (m *TxHash) XXX_Size() int {
return xxx_messageInfo_TxHash.Size(m) return xxx_messageInfo_TxHash.Size(m)
} }
func (m *TxHash) XXX_DiscardUnknown() { func (m *TxHash) XXX_DiscardUnknown() {
xxx_messageInfo_TxHash.DiscardUnknown(m) xxx_messageInfo_TxHash.DiscardUnknown(m)
} }
...@@ -562,15 +617,19 @@ func (*TimeStatus) Descriptor() ([]byte, []int) { ...@@ -562,15 +617,19 @@ func (*TimeStatus) Descriptor() ([]byte, []int) {
func (m *TimeStatus) XXX_Unmarshal(b []byte) error { func (m *TimeStatus) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TimeStatus.Unmarshal(m, b) return xxx_messageInfo_TimeStatus.Unmarshal(m, b)
} }
func (m *TimeStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *TimeStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TimeStatus.Marshal(b, m, deterministic) return xxx_messageInfo_TimeStatus.Marshal(b, m, deterministic)
} }
func (m *TimeStatus) XXX_Merge(src proto.Message) { func (m *TimeStatus) XXX_Merge(src proto.Message) {
xxx_messageInfo_TimeStatus.Merge(m, src) xxx_messageInfo_TimeStatus.Merge(m, src)
} }
func (m *TimeStatus) XXX_Size() int { func (m *TimeStatus) XXX_Size() int {
return xxx_messageInfo_TimeStatus.Size(m) return xxx_messageInfo_TimeStatus.Size(m)
} }
func (m *TimeStatus) XXX_DiscardUnknown() { func (m *TimeStatus) XXX_DiscardUnknown() {
xxx_messageInfo_TimeStatus.DiscardUnknown(m) xxx_messageInfo_TimeStatus.DiscardUnknown(m)
} }
...@@ -615,15 +674,19 @@ func (*ReqKey) Descriptor() ([]byte, []int) { ...@@ -615,15 +674,19 @@ func (*ReqKey) Descriptor() ([]byte, []int) {
func (m *ReqKey) XXX_Unmarshal(b []byte) error { func (m *ReqKey) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReqKey.Unmarshal(m, b) return xxx_messageInfo_ReqKey.Unmarshal(m, b)
} }
func (m *ReqKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *ReqKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReqKey.Marshal(b, m, deterministic) return xxx_messageInfo_ReqKey.Marshal(b, m, deterministic)
} }
func (m *ReqKey) XXX_Merge(src proto.Message) { func (m *ReqKey) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReqKey.Merge(m, src) xxx_messageInfo_ReqKey.Merge(m, src)
} }
func (m *ReqKey) XXX_Size() int { func (m *ReqKey) XXX_Size() int {
return xxx_messageInfo_ReqKey.Size(m) return xxx_messageInfo_ReqKey.Size(m)
} }
func (m *ReqKey) XXX_DiscardUnknown() { func (m *ReqKey) XXX_DiscardUnknown() {
xxx_messageInfo_ReqKey.DiscardUnknown(m) xxx_messageInfo_ReqKey.DiscardUnknown(m)
} }
...@@ -657,15 +720,19 @@ func (*ReqRandHash) Descriptor() ([]byte, []int) { ...@@ -657,15 +720,19 @@ func (*ReqRandHash) Descriptor() ([]byte, []int) {
func (m *ReqRandHash) XXX_Unmarshal(b []byte) error { func (m *ReqRandHash) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReqRandHash.Unmarshal(m, b) return xxx_messageInfo_ReqRandHash.Unmarshal(m, b)
} }
func (m *ReqRandHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *ReqRandHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReqRandHash.Marshal(b, m, deterministic) return xxx_messageInfo_ReqRandHash.Marshal(b, m, deterministic)
} }
func (m *ReqRandHash) XXX_Merge(src proto.Message) { func (m *ReqRandHash) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReqRandHash.Merge(m, src) xxx_messageInfo_ReqRandHash.Merge(m, src)
} }
func (m *ReqRandHash) XXX_Size() int { func (m *ReqRandHash) XXX_Size() int {
return xxx_messageInfo_ReqRandHash.Size(m) return xxx_messageInfo_ReqRandHash.Size(m)
} }
func (m *ReqRandHash) XXX_DiscardUnknown() { func (m *ReqRandHash) XXX_DiscardUnknown() {
xxx_messageInfo_ReqRandHash.DiscardUnknown(m) xxx_messageInfo_ReqRandHash.DiscardUnknown(m)
} }
...@@ -723,15 +790,19 @@ func (*VersionInfo) Descriptor() ([]byte, []int) { ...@@ -723,15 +790,19 @@ func (*VersionInfo) Descriptor() ([]byte, []int) {
func (m *VersionInfo) XXX_Unmarshal(b []byte) error { func (m *VersionInfo) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_VersionInfo.Unmarshal(m, b) return xxx_messageInfo_VersionInfo.Unmarshal(m, b)
} }
func (m *VersionInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *VersionInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_VersionInfo.Marshal(b, m, deterministic) return xxx_messageInfo_VersionInfo.Marshal(b, m, deterministic)
} }
func (m *VersionInfo) XXX_Merge(src proto.Message) { func (m *VersionInfo) XXX_Merge(src proto.Message) {
xxx_messageInfo_VersionInfo.Merge(m, src) xxx_messageInfo_VersionInfo.Merge(m, src)
} }
func (m *VersionInfo) XXX_Size() int { func (m *VersionInfo) XXX_Size() int {
return xxx_messageInfo_VersionInfo.Size(m) return xxx_messageInfo_VersionInfo.Size(m)
} }
func (m *VersionInfo) XXX_DiscardUnknown() { func (m *VersionInfo) XXX_DiscardUnknown() {
xxx_messageInfo_VersionInfo.DiscardUnknown(m) xxx_messageInfo_VersionInfo.DiscardUnknown(m)
} }
......
...@@ -5,14 +5,17 @@ package types ...@@ -5,14 +5,17 @@ package types
import ( import (
fmt "fmt" fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math" math "math"
proto "github.com/golang/protobuf/proto"
) )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal var (
var _ = fmt.Errorf _ = proto.Marshal
var _ = math.Inf _ = fmt.Errorf
_ = math.Inf
)
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
...@@ -26,9 +29,9 @@ type Transaction struct { ...@@ -26,9 +29,9 @@ type Transaction struct {
Signature *Signature `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` Signature *Signature `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"`
Fee int64 `protobuf:"varint,4,opt,name=fee,proto3" json:"fee,omitempty"` Fee int64 `protobuf:"varint,4,opt,name=fee,proto3" json:"fee,omitempty"`
Expire int64 `protobuf:"varint,5,opt,name=expire,proto3" json:"expire,omitempty"` Expire int64 `protobuf:"varint,5,opt,name=expire,proto3" json:"expire,omitempty"`
//随机ID,可以防止payload 相同的时候,交易重复 // 随机ID,可以防止payload 相同的时候,交易重复
Nonce int64 `protobuf:"varint,6,opt,name=nonce,proto3" json:"nonce,omitempty"` Nonce int64 `protobuf:"varint,6,opt,name=nonce,proto3" json:"nonce,omitempty"`
//对方地址,如果没有对方地址,可以为空 // 对方地址,如果没有对方地址,可以为空
To string `protobuf:"bytes,7,opt,name=to,proto3" json:"to,omitempty"` To string `protobuf:"bytes,7,opt,name=to,proto3" json:"to,omitempty"`
GroupCount int32 `protobuf:"varint,8,opt,name=groupCount,proto3" json:"groupCount,omitempty"` GroupCount int32 `protobuf:"varint,8,opt,name=groupCount,proto3" json:"groupCount,omitempty"`
Header []byte `protobuf:"bytes,9,opt,name=header,proto3" json:"header,omitempty"` Header []byte `protobuf:"bytes,9,opt,name=header,proto3" json:"header,omitempty"`
...@@ -48,15 +51,19 @@ func (*Transaction) Descriptor() ([]byte, []int) { ...@@ -48,15 +51,19 @@ func (*Transaction) Descriptor() ([]byte, []int) {
func (m *Transaction) XXX_Unmarshal(b []byte) error { func (m *Transaction) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Transaction.Unmarshal(m, b) return xxx_messageInfo_Transaction.Unmarshal(m, b)
} }
func (m *Transaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *Transaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Transaction.Marshal(b, m, deterministic) return xxx_messageInfo_Transaction.Marshal(b, m, deterministic)
} }
func (m *Transaction) XXX_Merge(src proto.Message) { func (m *Transaction) XXX_Merge(src proto.Message) {
xxx_messageInfo_Transaction.Merge(m, src) xxx_messageInfo_Transaction.Merge(m, src)
} }
func (m *Transaction) XXX_Size() int { func (m *Transaction) XXX_Size() int {
return xxx_messageInfo_Transaction.Size(m) return xxx_messageInfo_Transaction.Size(m)
} }
func (m *Transaction) XXX_DiscardUnknown() { func (m *Transaction) XXX_DiscardUnknown() {
xxx_messageInfo_Transaction.DiscardUnknown(m) xxx_messageInfo_Transaction.DiscardUnknown(m)
} }
...@@ -136,7 +143,7 @@ func (m *Transaction) GetNext() []byte { ...@@ -136,7 +143,7 @@ func (m *Transaction) GetNext() []byte {
type Signature struct { type Signature struct {
Ty int32 `protobuf:"varint,1,opt,name=ty,proto3" json:"ty,omitempty"` Ty int32 `protobuf:"varint,1,opt,name=ty,proto3" json:"ty,omitempty"`
Pubkey []byte `protobuf:"bytes,2,opt,name=pubkey,proto3" json:"pubkey,omitempty"` Pubkey []byte `protobuf:"bytes,2,opt,name=pubkey,proto3" json:"pubkey,omitempty"`
//当ty为5时,格式应该用RingSignature去解析 // 当ty为5时,格式应该用RingSignature去解析
Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
...@@ -153,15 +160,19 @@ func (*Signature) Descriptor() ([]byte, []int) { ...@@ -153,15 +160,19 @@ func (*Signature) Descriptor() ([]byte, []int) {
func (m *Signature) XXX_Unmarshal(b []byte) error { func (m *Signature) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Signature.Unmarshal(m, b) return xxx_messageInfo_Signature.Unmarshal(m, b)
} }
func (m *Signature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *Signature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Signature.Marshal(b, m, deterministic) return xxx_messageInfo_Signature.Marshal(b, m, deterministic)
} }
func (m *Signature) XXX_Merge(src proto.Message) { func (m *Signature) XXX_Merge(src proto.Message) {
xxx_messageInfo_Signature.Merge(m, src) xxx_messageInfo_Signature.Merge(m, src)
} }
func (m *Signature) XXX_Size() int { func (m *Signature) XXX_Size() int {
return xxx_messageInfo_Signature.Size(m) return xxx_messageInfo_Signature.Size(m)
} }
func (m *Signature) XXX_DiscardUnknown() { func (m *Signature) XXX_DiscardUnknown() {
xxx_messageInfo_Signature.DiscardUnknown(m) xxx_messageInfo_Signature.DiscardUnknown(m)
} }
......
...@@ -6,15 +6,18 @@ package types ...@@ -6,15 +6,18 @@ package types
import ( import (
context "context" context "context"
fmt "fmt" fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto" proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
math "math"
) )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal var (
var _ = fmt.Errorf _ = proto.Marshal
var _ = math.Inf _ = fmt.Errorf
_ = math.Inf
)
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
...@@ -22,7 +25,7 @@ var _ = math.Inf ...@@ -22,7 +25,7 @@ var _ = math.Inf
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
//后面如果有其他数据模型可继续往上面添加 // 后面如果有其他数据模型可继续往上面添加
type Storage struct { type Storage struct {
// Types that are valid to be assigned to Value: // Types that are valid to be assigned to Value:
// *Storage_ContentStorage // *Storage_ContentStorage
...@@ -48,15 +51,19 @@ func (*Storage) Descriptor() ([]byte, []int) { ...@@ -48,15 +51,19 @@ func (*Storage) Descriptor() ([]byte, []int) {
func (m *Storage) XXX_Unmarshal(b []byte) error { func (m *Storage) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Storage.Unmarshal(m, b) return xxx_messageInfo_Storage.Unmarshal(m, b)
} }
func (m *Storage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *Storage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Storage.Marshal(b, m, deterministic) return xxx_messageInfo_Storage.Marshal(b, m, deterministic)
} }
func (m *Storage) XXX_Merge(src proto.Message) { func (m *Storage) XXX_Merge(src proto.Message) {
xxx_messageInfo_Storage.Merge(m, src) xxx_messageInfo_Storage.Merge(m, src)
} }
func (m *Storage) XXX_Size() int { func (m *Storage) XXX_Size() int {
return xxx_messageInfo_Storage.Size(m) return xxx_messageInfo_Storage.Size(m)
} }
func (m *Storage) XXX_DiscardUnknown() { func (m *Storage) XXX_DiscardUnknown() {
xxx_messageInfo_Storage.DiscardUnknown(m) xxx_messageInfo_Storage.DiscardUnknown(m)
} }
...@@ -196,15 +203,19 @@ func (*StorageAction) Descriptor() ([]byte, []int) { ...@@ -196,15 +203,19 @@ func (*StorageAction) Descriptor() ([]byte, []int) {
func (m *StorageAction) XXX_Unmarshal(b []byte) error { func (m *StorageAction) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_StorageAction.Unmarshal(m, b) return xxx_messageInfo_StorageAction.Unmarshal(m, b)
} }
func (m *StorageAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *StorageAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_StorageAction.Marshal(b, m, deterministic) return xxx_messageInfo_StorageAction.Marshal(b, m, deterministic)
} }
func (m *StorageAction) XXX_Merge(src proto.Message) { func (m *StorageAction) XXX_Merge(src proto.Message) {
xxx_messageInfo_StorageAction.Merge(m, src) xxx_messageInfo_StorageAction.Merge(m, src)
} }
func (m *StorageAction) XXX_Size() int { func (m *StorageAction) XXX_Size() int {
return xxx_messageInfo_StorageAction.Size(m) return xxx_messageInfo_StorageAction.Size(m)
} }
func (m *StorageAction) XXX_DiscardUnknown() { func (m *StorageAction) XXX_DiscardUnknown() {
xxx_messageInfo_StorageAction.DiscardUnknown(m) xxx_messageInfo_StorageAction.DiscardUnknown(m)
} }
...@@ -321,13 +332,13 @@ func (*StorageAction) XXX_OneofWrappers() []interface{} { ...@@ -321,13 +332,13 @@ func (*StorageAction) XXX_OneofWrappers() []interface{} {
// 内容存证模型 // 内容存证模型
type ContentOnlyNotaryStorage struct { type ContentOnlyNotaryStorage struct {
//长度需要小于512k // 长度需要小于512k
Content []byte `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` Content []byte `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
//自定义的主键,可以为空,如果没传,则用txhash为key // 自定义的主键,可以为空,如果没传,则用txhash为key
Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
// Op 0表示创建 1表示追加add // Op 0表示创建 1表示追加add
Op int32 `protobuf:"varint,3,opt,name=op,proto3" json:"op,omitempty"` Op int32 `protobuf:"varint,3,opt,name=op,proto3" json:"op,omitempty"`
//字符串值 // 字符串值
Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
...@@ -344,15 +355,19 @@ func (*ContentOnlyNotaryStorage) Descriptor() ([]byte, []int) { ...@@ -344,15 +355,19 @@ func (*ContentOnlyNotaryStorage) Descriptor() ([]byte, []int) {
func (m *ContentOnlyNotaryStorage) XXX_Unmarshal(b []byte) error { func (m *ContentOnlyNotaryStorage) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ContentOnlyNotaryStorage.Unmarshal(m, b) return xxx_messageInfo_ContentOnlyNotaryStorage.Unmarshal(m, b)
} }
func (m *ContentOnlyNotaryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *ContentOnlyNotaryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ContentOnlyNotaryStorage.Marshal(b, m, deterministic) return xxx_messageInfo_ContentOnlyNotaryStorage.Marshal(b, m, deterministic)
} }
func (m *ContentOnlyNotaryStorage) XXX_Merge(src proto.Message) { func (m *ContentOnlyNotaryStorage) XXX_Merge(src proto.Message) {
xxx_messageInfo_ContentOnlyNotaryStorage.Merge(m, src) xxx_messageInfo_ContentOnlyNotaryStorage.Merge(m, src)
} }
func (m *ContentOnlyNotaryStorage) XXX_Size() int { func (m *ContentOnlyNotaryStorage) XXX_Size() int {
return xxx_messageInfo_ContentOnlyNotaryStorage.Size(m) return xxx_messageInfo_ContentOnlyNotaryStorage.Size(m)
} }
func (m *ContentOnlyNotaryStorage) XXX_DiscardUnknown() { func (m *ContentOnlyNotaryStorage) XXX_DiscardUnknown() {
xxx_messageInfo_ContentOnlyNotaryStorage.DiscardUnknown(m) xxx_messageInfo_ContentOnlyNotaryStorage.DiscardUnknown(m)
} }
...@@ -387,13 +402,13 @@ func (m *ContentOnlyNotaryStorage) GetValue() string { ...@@ -387,13 +402,13 @@ func (m *ContentOnlyNotaryStorage) GetValue() string {
return "" return ""
} }
//哈希存证模型,推荐使用sha256哈希,限制256位得摘要值 // 哈希存证模型,推荐使用sha256哈希,限制256位得摘要值
type HashOnlyNotaryStorage struct { type HashOnlyNotaryStorage struct {
//长度固定为32字节 // 长度固定为32字节
Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
//自定义的主键,可以为空,如果没传,则用txhash为key // 自定义的主键,可以为空,如果没传,则用txhash为key
Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
//字符串值 // 字符串值
Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
...@@ -410,15 +425,19 @@ func (*HashOnlyNotaryStorage) Descriptor() ([]byte, []int) { ...@@ -410,15 +425,19 @@ func (*HashOnlyNotaryStorage) Descriptor() ([]byte, []int) {
func (m *HashOnlyNotaryStorage) XXX_Unmarshal(b []byte) error { func (m *HashOnlyNotaryStorage) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_HashOnlyNotaryStorage.Unmarshal(m, b) return xxx_messageInfo_HashOnlyNotaryStorage.Unmarshal(m, b)
} }
func (m *HashOnlyNotaryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *HashOnlyNotaryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_HashOnlyNotaryStorage.Marshal(b, m, deterministic) return xxx_messageInfo_HashOnlyNotaryStorage.Marshal(b, m, deterministic)
} }
func (m *HashOnlyNotaryStorage) XXX_Merge(src proto.Message) { func (m *HashOnlyNotaryStorage) XXX_Merge(src proto.Message) {
xxx_messageInfo_HashOnlyNotaryStorage.Merge(m, src) xxx_messageInfo_HashOnlyNotaryStorage.Merge(m, src)
} }
func (m *HashOnlyNotaryStorage) XXX_Size() int { func (m *HashOnlyNotaryStorage) XXX_Size() int {
return xxx_messageInfo_HashOnlyNotaryStorage.Size(m) return xxx_messageInfo_HashOnlyNotaryStorage.Size(m)
} }
func (m *HashOnlyNotaryStorage) XXX_DiscardUnknown() { func (m *HashOnlyNotaryStorage) XXX_DiscardUnknown() {
xxx_messageInfo_HashOnlyNotaryStorage.DiscardUnknown(m) xxx_messageInfo_HashOnlyNotaryStorage.DiscardUnknown(m)
} }
...@@ -448,13 +467,13 @@ func (m *HashOnlyNotaryStorage) GetValue() string { ...@@ -448,13 +467,13 @@ func (m *HashOnlyNotaryStorage) GetValue() string {
// 链接存证模型 // 链接存证模型
type LinkNotaryStorage struct { type LinkNotaryStorage struct {
//存证内容的链接,可以写入URL,或者其他可用于定位源文件得线索. // 存证内容的链接,可以写入URL,或者其他可用于定位源文件得线索.
Link []byte `protobuf:"bytes,1,opt,name=link,proto3" json:"link,omitempty"` Link []byte `protobuf:"bytes,1,opt,name=link,proto3" json:"link,omitempty"`
//源文件得hash值,推荐使用sha256哈希,限制256位得摘要值 // 源文件得hash值,推荐使用sha256哈希,限制256位得摘要值
Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
//自定义的主键,可以为空,如果没传,则用txhash为key // 自定义的主键,可以为空,如果没传,则用txhash为key
Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
//字符串值 // 字符串值
Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
...@@ -471,15 +490,19 @@ func (*LinkNotaryStorage) Descriptor() ([]byte, []int) { ...@@ -471,15 +490,19 @@ func (*LinkNotaryStorage) Descriptor() ([]byte, []int) {
func (m *LinkNotaryStorage) XXX_Unmarshal(b []byte) error { func (m *LinkNotaryStorage) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_LinkNotaryStorage.Unmarshal(m, b) return xxx_messageInfo_LinkNotaryStorage.Unmarshal(m, b)
} }
func (m *LinkNotaryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *LinkNotaryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_LinkNotaryStorage.Marshal(b, m, deterministic) return xxx_messageInfo_LinkNotaryStorage.Marshal(b, m, deterministic)
} }
func (m *LinkNotaryStorage) XXX_Merge(src proto.Message) { func (m *LinkNotaryStorage) XXX_Merge(src proto.Message) {
xxx_messageInfo_LinkNotaryStorage.Merge(m, src) xxx_messageInfo_LinkNotaryStorage.Merge(m, src)
} }
func (m *LinkNotaryStorage) XXX_Size() int { func (m *LinkNotaryStorage) XXX_Size() int {
return xxx_messageInfo_LinkNotaryStorage.Size(m) return xxx_messageInfo_LinkNotaryStorage.Size(m)
} }
func (m *LinkNotaryStorage) XXX_DiscardUnknown() { func (m *LinkNotaryStorage) XXX_DiscardUnknown() {
xxx_messageInfo_LinkNotaryStorage.DiscardUnknown(m) xxx_messageInfo_LinkNotaryStorage.DiscardUnknown(m)
} }
...@@ -516,15 +539,15 @@ func (m *LinkNotaryStorage) GetValue() string { ...@@ -516,15 +539,15 @@ func (m *LinkNotaryStorage) GetValue() string {
// 隐私存证模型,如果一个文件需要存证,且不公开内容,可以选择将源文件通过对称加密算法加密后上链 // 隐私存证模型,如果一个文件需要存证,且不公开内容,可以选择将源文件通过对称加密算法加密后上链
type EncryptNotaryStorage struct { type EncryptNotaryStorage struct {
//存证明文内容的hash值,推荐使用sha256哈希,限制256位得摘要值 // 存证明文内容的hash值,推荐使用sha256哈希,限制256位得摘要值
ContentHash []byte `protobuf:"bytes,1,opt,name=contentHash,proto3" json:"contentHash,omitempty"` ContentHash []byte `protobuf:"bytes,1,opt,name=contentHash,proto3" json:"contentHash,omitempty"`
//源文件得密文,由加密key及nonce对明文加密得到该值。 // 源文件得密文,由加密key及nonce对明文加密得到该值。
EncryptContent []byte `protobuf:"bytes,2,opt,name=encryptContent,proto3" json:"encryptContent,omitempty"` EncryptContent []byte `protobuf:"bytes,2,opt,name=encryptContent,proto3" json:"encryptContent,omitempty"`
//加密iv,通过AES进行加密时制定随机生成的iv,解密时需要使用该值 // 加密iv,通过AES进行加密时制定随机生成的iv,解密时需要使用该值
Nonce []byte `protobuf:"bytes,3,opt,name=nonce,proto3" json:"nonce,omitempty"` Nonce []byte `protobuf:"bytes,3,opt,name=nonce,proto3" json:"nonce,omitempty"`
//自定义的主键,可以为空,如果没传,则用txhash为key // 自定义的主键,可以为空,如果没传,则用txhash为key
Key string `protobuf:"bytes,4,opt,name=key,proto3" json:"key,omitempty"` Key string `protobuf:"bytes,4,opt,name=key,proto3" json:"key,omitempty"`
//字符串值 // 字符串值
Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
...@@ -541,15 +564,19 @@ func (*EncryptNotaryStorage) Descriptor() ([]byte, []int) { ...@@ -541,15 +564,19 @@ func (*EncryptNotaryStorage) Descriptor() ([]byte, []int) {
func (m *EncryptNotaryStorage) XXX_Unmarshal(b []byte) error { func (m *EncryptNotaryStorage) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_EncryptNotaryStorage.Unmarshal(m, b) return xxx_messageInfo_EncryptNotaryStorage.Unmarshal(m, b)
} }
func (m *EncryptNotaryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *EncryptNotaryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_EncryptNotaryStorage.Marshal(b, m, deterministic) return xxx_messageInfo_EncryptNotaryStorage.Marshal(b, m, deterministic)
} }
func (m *EncryptNotaryStorage) XXX_Merge(src proto.Message) { func (m *EncryptNotaryStorage) XXX_Merge(src proto.Message) {
xxx_messageInfo_EncryptNotaryStorage.Merge(m, src) xxx_messageInfo_EncryptNotaryStorage.Merge(m, src)
} }
func (m *EncryptNotaryStorage) XXX_Size() int { func (m *EncryptNotaryStorage) XXX_Size() int {
return xxx_messageInfo_EncryptNotaryStorage.Size(m) return xxx_messageInfo_EncryptNotaryStorage.Size(m)
} }
func (m *EncryptNotaryStorage) XXX_DiscardUnknown() { func (m *EncryptNotaryStorage) XXX_DiscardUnknown() {
xxx_messageInfo_EncryptNotaryStorage.DiscardUnknown(m) xxx_messageInfo_EncryptNotaryStorage.DiscardUnknown(m)
} }
...@@ -593,15 +620,15 @@ func (m *EncryptNotaryStorage) GetValue() string { ...@@ -593,15 +620,15 @@ func (m *EncryptNotaryStorage) GetValue() string {
// 分享隐私存证模型,需要完备的sdk或者相应的密钥库支持 // 分享隐私存证模型,需要完备的sdk或者相应的密钥库支持
type EncryptShareNotaryStorage struct { type EncryptShareNotaryStorage struct {
//存证明文内容的hash值,推荐使用sha256哈希,限制256位得摘要值 // 存证明文内容的hash值,推荐使用sha256哈希,限制256位得摘要值
ContentHash []byte `protobuf:"bytes,1,opt,name=contentHash,proto3" json:"contentHash,omitempty"` ContentHash []byte `protobuf:"bytes,1,opt,name=contentHash,proto3" json:"contentHash,omitempty"`
//源文件得密文。,用公钥地址加密 // 源文件得密文。,用公钥地址加密
EncryptContent []byte `protobuf:"bytes,2,opt,name=encryptContent,proto3" json:"encryptContent,omitempty"` EncryptContent []byte `protobuf:"bytes,2,opt,name=encryptContent,proto3" json:"encryptContent,omitempty"`
//公钥 // 公钥
PubKey []byte `protobuf:"bytes,3,opt,name=pubKey,proto3" json:"pubKey,omitempty"` PubKey []byte `protobuf:"bytes,3,opt,name=pubKey,proto3" json:"pubKey,omitempty"`
//自定义的主键,可以为空,如果没传,则用txhash为key // 自定义的主键,可以为空,如果没传,则用txhash为key
Key string `protobuf:"bytes,4,opt,name=key,proto3" json:"key,omitempty"` Key string `protobuf:"bytes,4,opt,name=key,proto3" json:"key,omitempty"`
//字符串值 // 字符串值
Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
...@@ -618,15 +645,19 @@ func (*EncryptShareNotaryStorage) Descriptor() ([]byte, []int) { ...@@ -618,15 +645,19 @@ func (*EncryptShareNotaryStorage) Descriptor() ([]byte, []int) {
func (m *EncryptShareNotaryStorage) XXX_Unmarshal(b []byte) error { func (m *EncryptShareNotaryStorage) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_EncryptShareNotaryStorage.Unmarshal(m, b) return xxx_messageInfo_EncryptShareNotaryStorage.Unmarshal(m, b)
} }
func (m *EncryptShareNotaryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *EncryptShareNotaryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_EncryptShareNotaryStorage.Marshal(b, m, deterministic) return xxx_messageInfo_EncryptShareNotaryStorage.Marshal(b, m, deterministic)
} }
func (m *EncryptShareNotaryStorage) XXX_Merge(src proto.Message) { func (m *EncryptShareNotaryStorage) XXX_Merge(src proto.Message) {
xxx_messageInfo_EncryptShareNotaryStorage.Merge(m, src) xxx_messageInfo_EncryptShareNotaryStorage.Merge(m, src)
} }
func (m *EncryptShareNotaryStorage) XXX_Size() int { func (m *EncryptShareNotaryStorage) XXX_Size() int {
return xxx_messageInfo_EncryptShareNotaryStorage.Size(m) return xxx_messageInfo_EncryptShareNotaryStorage.Size(m)
} }
func (m *EncryptShareNotaryStorage) XXX_DiscardUnknown() { func (m *EncryptShareNotaryStorage) XXX_DiscardUnknown() {
xxx_messageInfo_EncryptShareNotaryStorage.DiscardUnknown(m) xxx_messageInfo_EncryptShareNotaryStorage.DiscardUnknown(m)
} }
...@@ -670,9 +701,9 @@ func (m *EncryptShareNotaryStorage) GetValue() string { ...@@ -670,9 +701,9 @@ func (m *EncryptShareNotaryStorage) GetValue() string {
// 加密存证数据运算 // 加密存证数据运算
type EncryptNotaryAdd struct { type EncryptNotaryAdd struct {
//源操作数存证索引 // 源操作数存证索引
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
//待操作数据 // 待操作数据
EncryptAdd []byte `protobuf:"bytes,2,opt,name=encryptAdd,proto3" json:"encryptAdd,omitempty"` EncryptAdd []byte `protobuf:"bytes,2,opt,name=encryptAdd,proto3" json:"encryptAdd,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
...@@ -689,15 +720,19 @@ func (*EncryptNotaryAdd) Descriptor() ([]byte, []int) { ...@@ -689,15 +720,19 @@ func (*EncryptNotaryAdd) Descriptor() ([]byte, []int) {
func (m *EncryptNotaryAdd) XXX_Unmarshal(b []byte) error { func (m *EncryptNotaryAdd) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_EncryptNotaryAdd.Unmarshal(m, b) return xxx_messageInfo_EncryptNotaryAdd.Unmarshal(m, b)
} }
func (m *EncryptNotaryAdd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *EncryptNotaryAdd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_EncryptNotaryAdd.Marshal(b, m, deterministic) return xxx_messageInfo_EncryptNotaryAdd.Marshal(b, m, deterministic)
} }
func (m *EncryptNotaryAdd) XXX_Merge(src proto.Message) { func (m *EncryptNotaryAdd) XXX_Merge(src proto.Message) {
xxx_messageInfo_EncryptNotaryAdd.Merge(m, src) xxx_messageInfo_EncryptNotaryAdd.Merge(m, src)
} }
func (m *EncryptNotaryAdd) XXX_Size() int { func (m *EncryptNotaryAdd) XXX_Size() int {
return xxx_messageInfo_EncryptNotaryAdd.Size(m) return xxx_messageInfo_EncryptNotaryAdd.Size(m)
} }
func (m *EncryptNotaryAdd) XXX_DiscardUnknown() { func (m *EncryptNotaryAdd) XXX_DiscardUnknown() {
xxx_messageInfo_EncryptNotaryAdd.DiscardUnknown(m) xxx_messageInfo_EncryptNotaryAdd.DiscardUnknown(m)
} }
...@@ -718,7 +753,7 @@ func (m *EncryptNotaryAdd) GetEncryptAdd() []byte { ...@@ -718,7 +753,7 @@ func (m *EncryptNotaryAdd) GetEncryptAdd() []byte {
return nil return nil
} }
//根据txhash去状态数据库中查询存储内容 // 根据txhash去状态数据库中查询存储内容
type QueryStorage struct { type QueryStorage struct {
TxHash string `protobuf:"bytes,1,opt,name=txHash,proto3" json:"txHash,omitempty"` TxHash string `protobuf:"bytes,1,opt,name=txHash,proto3" json:"txHash,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
...@@ -736,15 +771,19 @@ func (*QueryStorage) Descriptor() ([]byte, []int) { ...@@ -736,15 +771,19 @@ func (*QueryStorage) Descriptor() ([]byte, []int) {
func (m *QueryStorage) XXX_Unmarshal(b []byte) error { func (m *QueryStorage) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_QueryStorage.Unmarshal(m, b) return xxx_messageInfo_QueryStorage.Unmarshal(m, b)
} }
func (m *QueryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *QueryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_QueryStorage.Marshal(b, m, deterministic) return xxx_messageInfo_QueryStorage.Marshal(b, m, deterministic)
} }
func (m *QueryStorage) XXX_Merge(src proto.Message) { func (m *QueryStorage) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryStorage.Merge(m, src) xxx_messageInfo_QueryStorage.Merge(m, src)
} }
func (m *QueryStorage) XXX_Size() int { func (m *QueryStorage) XXX_Size() int {
return xxx_messageInfo_QueryStorage.Size(m) return xxx_messageInfo_QueryStorage.Size(m)
} }
func (m *QueryStorage) XXX_DiscardUnknown() { func (m *QueryStorage) XXX_DiscardUnknown() {
xxx_messageInfo_QueryStorage.DiscardUnknown(m) xxx_messageInfo_QueryStorage.DiscardUnknown(m)
} }
...@@ -758,7 +797,7 @@ func (m *QueryStorage) GetTxHash() string { ...@@ -758,7 +797,7 @@ func (m *QueryStorage) GetTxHash() string {
return "" return ""
} }
//批量查询有可能导致数据库崩溃 // 批量查询有可能导致数据库崩溃
type BatchQueryStorage struct { type BatchQueryStorage struct {
TxHashs []string `protobuf:"bytes,1,rep,name=txHashs,proto3" json:"txHashs,omitempty"` TxHashs []string `protobuf:"bytes,1,rep,name=txHashs,proto3" json:"txHashs,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
...@@ -776,15 +815,19 @@ func (*BatchQueryStorage) Descriptor() ([]byte, []int) { ...@@ -776,15 +815,19 @@ func (*BatchQueryStorage) Descriptor() ([]byte, []int) {
func (m *BatchQueryStorage) XXX_Unmarshal(b []byte) error { func (m *BatchQueryStorage) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BatchQueryStorage.Unmarshal(m, b) return xxx_messageInfo_BatchQueryStorage.Unmarshal(m, b)
} }
func (m *BatchQueryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *BatchQueryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BatchQueryStorage.Marshal(b, m, deterministic) return xxx_messageInfo_BatchQueryStorage.Marshal(b, m, deterministic)
} }
func (m *BatchQueryStorage) XXX_Merge(src proto.Message) { func (m *BatchQueryStorage) XXX_Merge(src proto.Message) {
xxx_messageInfo_BatchQueryStorage.Merge(m, src) xxx_messageInfo_BatchQueryStorage.Merge(m, src)
} }
func (m *BatchQueryStorage) XXX_Size() int { func (m *BatchQueryStorage) XXX_Size() int {
return xxx_messageInfo_BatchQueryStorage.Size(m) return xxx_messageInfo_BatchQueryStorage.Size(m)
} }
func (m *BatchQueryStorage) XXX_DiscardUnknown() { func (m *BatchQueryStorage) XXX_DiscardUnknown() {
xxx_messageInfo_BatchQueryStorage.DiscardUnknown(m) xxx_messageInfo_BatchQueryStorage.DiscardUnknown(m)
} }
...@@ -815,15 +858,19 @@ func (*BatchReplyStorage) Descriptor() ([]byte, []int) { ...@@ -815,15 +858,19 @@ func (*BatchReplyStorage) Descriptor() ([]byte, []int) {
func (m *BatchReplyStorage) XXX_Unmarshal(b []byte) error { func (m *BatchReplyStorage) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BatchReplyStorage.Unmarshal(m, b) return xxx_messageInfo_BatchReplyStorage.Unmarshal(m, b)
} }
func (m *BatchReplyStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *BatchReplyStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BatchReplyStorage.Marshal(b, m, deterministic) return xxx_messageInfo_BatchReplyStorage.Marshal(b, m, deterministic)
} }
func (m *BatchReplyStorage) XXX_Merge(src proto.Message) { func (m *BatchReplyStorage) XXX_Merge(src proto.Message) {
xxx_messageInfo_BatchReplyStorage.Merge(m, src) xxx_messageInfo_BatchReplyStorage.Merge(m, src)
} }
func (m *BatchReplyStorage) XXX_Size() int { func (m *BatchReplyStorage) XXX_Size() int {
return xxx_messageInfo_BatchReplyStorage.Size(m) return xxx_messageInfo_BatchReplyStorage.Size(m)
} }
func (m *BatchReplyStorage) XXX_DiscardUnknown() { func (m *BatchReplyStorage) XXX_DiscardUnknown() {
xxx_messageInfo_BatchReplyStorage.DiscardUnknown(m) xxx_messageInfo_BatchReplyStorage.DiscardUnknown(m)
} }
...@@ -853,15 +900,19 @@ func (*ReceiptStorage) Descriptor() ([]byte, []int) { ...@@ -853,15 +900,19 @@ func (*ReceiptStorage) Descriptor() ([]byte, []int) {
func (m *ReceiptStorage) XXX_Unmarshal(b []byte) error { func (m *ReceiptStorage) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReceiptStorage.Unmarshal(m, b) return xxx_messageInfo_ReceiptStorage.Unmarshal(m, b)
} }
func (m *ReceiptStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *ReceiptStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReceiptStorage.Marshal(b, m, deterministic) return xxx_messageInfo_ReceiptStorage.Marshal(b, m, deterministic)
} }
func (m *ReceiptStorage) XXX_Merge(src proto.Message) { func (m *ReceiptStorage) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReceiptStorage.Merge(m, src) xxx_messageInfo_ReceiptStorage.Merge(m, src)
} }
func (m *ReceiptStorage) XXX_Size() int { func (m *ReceiptStorage) XXX_Size() int {
return xxx_messageInfo_ReceiptStorage.Size(m) return xxx_messageInfo_ReceiptStorage.Size(m)
} }
func (m *ReceiptStorage) XXX_DiscardUnknown() { func (m *ReceiptStorage) XXX_DiscardUnknown() {
xxx_messageInfo_ReceiptStorage.DiscardUnknown(m) xxx_messageInfo_ReceiptStorage.DiscardUnknown(m)
} }
...@@ -925,8 +976,10 @@ var fileDescriptor_0d2c4ccf1453ffdb = []byte{ ...@@ -925,8 +976,10 @@ var fileDescriptor_0d2c4ccf1453ffdb = []byte{
} }
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
var _ context.Context var (
var _ grpc.ClientConnInterface _ context.Context
_ grpc.ClientConnInterface
)
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against. // is compatible with the grpc package it is being compiled against.
...@@ -935,8 +988,7 @@ const _ = grpc.SupportPackageIsVersion6 ...@@ -935,8 +988,7 @@ const _ = grpc.SupportPackageIsVersion6
// StorageClient is the client API for Storage service. // StorageClient is the client API for Storage service.
// //
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type StorageClient interface { type StorageClient interface{}
}
type storageClient struct { type storageClient struct {
cc grpc.ClientConnInterface cc grpc.ClientConnInterface
...@@ -947,12 +999,10 @@ func NewStorageClient(cc grpc.ClientConnInterface) StorageClient { ...@@ -947,12 +999,10 @@ func NewStorageClient(cc grpc.ClientConnInterface) StorageClient {
} }
// StorageServer is the server API for Storage service. // StorageServer is the server API for Storage service.
type StorageServer interface { type StorageServer interface{}
}
// UnimplementedStorageServer can be embedded to have forward compatible implementations. // UnimplementedStorageServer can be embedded to have forward compatible implementations.
type UnimplementedStorageServer struct { type UnimplementedStorageServer struct{}
}
func RegisterStorageServer(s *grpc.Server, srv StorageServer) { func RegisterStorageServer(s *grpc.Server, srv StorageServer) {
s.RegisterService(&_Storage_serviceDesc, srv) s.RegisterService(&_Storage_serviceDesc, srv)
......
...@@ -2,19 +2,20 @@ package types ...@@ -2,19 +2,20 @@ package types
import ( import (
"encoding/hex" "encoding/hex"
"io/ioutil"
secp256k1 "github.com/btcsuite/btcd/btcec" secp256k1 "github.com/btcsuite/btcd/btcec"
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
"io/ioutil"
) )
//exec type // exec type
const ( const (
ExecErr = 0 ExecErr = 0
ExecPack = 1 ExecPack = 1
ExecOk = 2 ExecOk = 2
) )
//FromHex hex -> []byte // FromHex hex -> []byte
func FromHex(s string) ([]byte, error) { func FromHex(s string) ([]byte, error) {
if len(s) > 1 { if len(s) > 1 {
if s[0:2] == "0x" || s[0:2] == "0X" { if s[0:2] == "0x" || s[0:2] == "0X" {
...@@ -28,7 +29,7 @@ func FromHex(s string) ([]byte, error) { ...@@ -28,7 +29,7 @@ func FromHex(s string) ([]byte, error) {
return []byte{}, nil return []byte{}, nil
} }
//ToHex []byte -> hex // ToHex []byte -> hex
func ToHex(b []byte) string { func ToHex(b []byte) string {
hex := hex.EncodeToString(b) hex := hex.EncodeToString(b)
// Prefer output of "0x0" instead of "0x" // Prefer output of "0x0" instead of "0x"
...@@ -38,7 +39,7 @@ func ToHex(b []byte) string { ...@@ -38,7 +39,7 @@ func ToHex(b []byte) string {
return hex return hex
} }
//ToHex []byte -> hex // ToHex []byte -> hex
func ToHexPrefix(b []byte) string { func ToHexPrefix(b []byte) string {
hex := hex.EncodeToString(b) hex := hex.EncodeToString(b)
// Prefer output of "0x0" instead of "0x" // Prefer output of "0x0" instead of "0x"
...@@ -48,7 +49,7 @@ func ToHexPrefix(b []byte) string { ...@@ -48,7 +49,7 @@ func ToHexPrefix(b []byte) string {
return "0x" + hex return "0x" + hex
} }
//Encode 编码 // Encode 编码
func Encode(data proto.Message) []byte { func Encode(data proto.Message) []byte {
b, err := proto.Marshal(data) b, err := proto.Marshal(data)
if err != nil { if err != nil {
...@@ -57,7 +58,7 @@ func Encode(data proto.Message) []byte { ...@@ -57,7 +58,7 @@ func Encode(data proto.Message) []byte {
return b return b
} }
//Decode 解码 // Decode 解码
func Decode(data []byte, msg proto.Message) error { func Decode(data []byte, msg proto.Message) error {
return proto.Unmarshal(data, msg) return proto.Unmarshal(data, msg)
} }
......
...@@ -5,14 +5,17 @@ package types ...@@ -5,14 +5,17 @@ package types
import ( import (
fmt "fmt" fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math" math "math"
proto "github.com/golang/protobuf/proto"
) )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal var (
var _ = fmt.Errorf _ = proto.Marshal
var _ = math.Inf _ = fmt.Errorf
_ = math.Inf
)
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
...@@ -41,15 +44,19 @@ func (*WasmAction) Descriptor() ([]byte, []int) { ...@@ -41,15 +44,19 @@ func (*WasmAction) Descriptor() ([]byte, []int) {
func (m *WasmAction) XXX_Unmarshal(b []byte) error { func (m *WasmAction) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_WasmAction.Unmarshal(m, b) return xxx_messageInfo_WasmAction.Unmarshal(m, b)
} }
func (m *WasmAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *WasmAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_WasmAction.Marshal(b, m, deterministic) return xxx_messageInfo_WasmAction.Marshal(b, m, deterministic)
} }
func (m *WasmAction) XXX_Merge(src proto.Message) { func (m *WasmAction) XXX_Merge(src proto.Message) {
xxx_messageInfo_WasmAction.Merge(m, src) xxx_messageInfo_WasmAction.Merge(m, src)
} }
func (m *WasmAction) XXX_Size() int { func (m *WasmAction) XXX_Size() int {
return xxx_messageInfo_WasmAction.Size(m) return xxx_messageInfo_WasmAction.Size(m)
} }
func (m *WasmAction) XXX_DiscardUnknown() { func (m *WasmAction) XXX_DiscardUnknown() {
xxx_messageInfo_WasmAction.DiscardUnknown(m) xxx_messageInfo_WasmAction.DiscardUnknown(m)
} }
...@@ -126,15 +133,19 @@ func (*WasmCreate) Descriptor() ([]byte, []int) { ...@@ -126,15 +133,19 @@ func (*WasmCreate) Descriptor() ([]byte, []int) {
func (m *WasmCreate) XXX_Unmarshal(b []byte) error { func (m *WasmCreate) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_WasmCreate.Unmarshal(m, b) return xxx_messageInfo_WasmCreate.Unmarshal(m, b)
} }
func (m *WasmCreate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *WasmCreate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_WasmCreate.Marshal(b, m, deterministic) return xxx_messageInfo_WasmCreate.Marshal(b, m, deterministic)
} }
func (m *WasmCreate) XXX_Merge(src proto.Message) { func (m *WasmCreate) XXX_Merge(src proto.Message) {
xxx_messageInfo_WasmCreate.Merge(m, src) xxx_messageInfo_WasmCreate.Merge(m, src)
} }
func (m *WasmCreate) XXX_Size() int { func (m *WasmCreate) XXX_Size() int {
return xxx_messageInfo_WasmCreate.Size(m) return xxx_messageInfo_WasmCreate.Size(m)
} }
func (m *WasmCreate) XXX_DiscardUnknown() { func (m *WasmCreate) XXX_DiscardUnknown() {
xxx_messageInfo_WasmCreate.DiscardUnknown(m) xxx_messageInfo_WasmCreate.DiscardUnknown(m)
} }
...@@ -175,15 +186,19 @@ func (*WasmCall) Descriptor() ([]byte, []int) { ...@@ -175,15 +186,19 @@ func (*WasmCall) Descriptor() ([]byte, []int) {
func (m *WasmCall) XXX_Unmarshal(b []byte) error { func (m *WasmCall) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_WasmCall.Unmarshal(m, b) return xxx_messageInfo_WasmCall.Unmarshal(m, b)
} }
func (m *WasmCall) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *WasmCall) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_WasmCall.Marshal(b, m, deterministic) return xxx_messageInfo_WasmCall.Marshal(b, m, deterministic)
} }
func (m *WasmCall) XXX_Merge(src proto.Message) { func (m *WasmCall) XXX_Merge(src proto.Message) {
xxx_messageInfo_WasmCall.Merge(m, src) xxx_messageInfo_WasmCall.Merge(m, src)
} }
func (m *WasmCall) XXX_Size() int { func (m *WasmCall) XXX_Size() int {
return xxx_messageInfo_WasmCall.Size(m) return xxx_messageInfo_WasmCall.Size(m)
} }
func (m *WasmCall) XXX_DiscardUnknown() { func (m *WasmCall) XXX_DiscardUnknown() {
xxx_messageInfo_WasmCall.DiscardUnknown(m) xxx_messageInfo_WasmCall.DiscardUnknown(m)
} }
...@@ -235,15 +250,19 @@ func (*QueryCheckContract) Descriptor() ([]byte, []int) { ...@@ -235,15 +250,19 @@ func (*QueryCheckContract) Descriptor() ([]byte, []int) {
func (m *QueryCheckContract) XXX_Unmarshal(b []byte) error { func (m *QueryCheckContract) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_QueryCheckContract.Unmarshal(m, b) return xxx_messageInfo_QueryCheckContract.Unmarshal(m, b)
} }
func (m *QueryCheckContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *QueryCheckContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_QueryCheckContract.Marshal(b, m, deterministic) return xxx_messageInfo_QueryCheckContract.Marshal(b, m, deterministic)
} }
func (m *QueryCheckContract) XXX_Merge(src proto.Message) { func (m *QueryCheckContract) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryCheckContract.Merge(m, src) xxx_messageInfo_QueryCheckContract.Merge(m, src)
} }
func (m *QueryCheckContract) XXX_Size() int { func (m *QueryCheckContract) XXX_Size() int {
return xxx_messageInfo_QueryCheckContract.Size(m) return xxx_messageInfo_QueryCheckContract.Size(m)
} }
func (m *QueryCheckContract) XXX_DiscardUnknown() { func (m *QueryCheckContract) XXX_DiscardUnknown() {
xxx_messageInfo_QueryCheckContract.DiscardUnknown(m) xxx_messageInfo_QueryCheckContract.DiscardUnknown(m)
} }
...@@ -274,15 +293,19 @@ func (*CustomLog) Descriptor() ([]byte, []int) { ...@@ -274,15 +293,19 @@ func (*CustomLog) Descriptor() ([]byte, []int) {
func (m *CustomLog) XXX_Unmarshal(b []byte) error { func (m *CustomLog) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CustomLog.Unmarshal(m, b) return xxx_messageInfo_CustomLog.Unmarshal(m, b)
} }
func (m *CustomLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *CustomLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CustomLog.Marshal(b, m, deterministic) return xxx_messageInfo_CustomLog.Marshal(b, m, deterministic)
} }
func (m *CustomLog) XXX_Merge(src proto.Message) { func (m *CustomLog) XXX_Merge(src proto.Message) {
xxx_messageInfo_CustomLog.Merge(m, src) xxx_messageInfo_CustomLog.Merge(m, src)
} }
func (m *CustomLog) XXX_Size() int { func (m *CustomLog) XXX_Size() int {
return xxx_messageInfo_CustomLog.Size(m) return xxx_messageInfo_CustomLog.Size(m)
} }
func (m *CustomLog) XXX_DiscardUnknown() { func (m *CustomLog) XXX_DiscardUnknown() {
xxx_messageInfo_CustomLog.DiscardUnknown(m) xxx_messageInfo_CustomLog.DiscardUnknown(m)
} }
...@@ -314,15 +337,19 @@ func (*CreateContractLog) Descriptor() ([]byte, []int) { ...@@ -314,15 +337,19 @@ func (*CreateContractLog) Descriptor() ([]byte, []int) {
func (m *CreateContractLog) XXX_Unmarshal(b []byte) error { func (m *CreateContractLog) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CreateContractLog.Unmarshal(m, b) return xxx_messageInfo_CreateContractLog.Unmarshal(m, b)
} }
func (m *CreateContractLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *CreateContractLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CreateContractLog.Marshal(b, m, deterministic) return xxx_messageInfo_CreateContractLog.Marshal(b, m, deterministic)
} }
func (m *CreateContractLog) XXX_Merge(src proto.Message) { func (m *CreateContractLog) XXX_Merge(src proto.Message) {
xxx_messageInfo_CreateContractLog.Merge(m, src) xxx_messageInfo_CreateContractLog.Merge(m, src)
} }
func (m *CreateContractLog) XXX_Size() int { func (m *CreateContractLog) XXX_Size() int {
return xxx_messageInfo_CreateContractLog.Size(m) return xxx_messageInfo_CreateContractLog.Size(m)
} }
func (m *CreateContractLog) XXX_DiscardUnknown() { func (m *CreateContractLog) XXX_DiscardUnknown() {
xxx_messageInfo_CreateContractLog.DiscardUnknown(m) xxx_messageInfo_CreateContractLog.DiscardUnknown(m)
} }
...@@ -362,15 +389,19 @@ func (*CallContractLog) Descriptor() ([]byte, []int) { ...@@ -362,15 +389,19 @@ func (*CallContractLog) Descriptor() ([]byte, []int) {
func (m *CallContractLog) XXX_Unmarshal(b []byte) error { func (m *CallContractLog) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CallContractLog.Unmarshal(m, b) return xxx_messageInfo_CallContractLog.Unmarshal(m, b)
} }
func (m *CallContractLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *CallContractLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CallContractLog.Marshal(b, m, deterministic) return xxx_messageInfo_CallContractLog.Marshal(b, m, deterministic)
} }
func (m *CallContractLog) XXX_Merge(src proto.Message) { func (m *CallContractLog) XXX_Merge(src proto.Message) {
xxx_messageInfo_CallContractLog.Merge(m, src) xxx_messageInfo_CallContractLog.Merge(m, src)
} }
func (m *CallContractLog) XXX_Size() int { func (m *CallContractLog) XXX_Size() int {
return xxx_messageInfo_CallContractLog.Size(m) return xxx_messageInfo_CallContractLog.Size(m)
} }
func (m *CallContractLog) XXX_DiscardUnknown() { func (m *CallContractLog) XXX_DiscardUnknown() {
xxx_messageInfo_CallContractLog.DiscardUnknown(m) xxx_messageInfo_CallContractLog.DiscardUnknown(m)
} }
...@@ -416,15 +447,19 @@ func (*LocalDataLog) Descriptor() ([]byte, []int) { ...@@ -416,15 +447,19 @@ func (*LocalDataLog) Descriptor() ([]byte, []int) {
func (m *LocalDataLog) XXX_Unmarshal(b []byte) error { func (m *LocalDataLog) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_LocalDataLog.Unmarshal(m, b) return xxx_messageInfo_LocalDataLog.Unmarshal(m, b)
} }
func (m *LocalDataLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *LocalDataLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_LocalDataLog.Marshal(b, m, deterministic) return xxx_messageInfo_LocalDataLog.Marshal(b, m, deterministic)
} }
func (m *LocalDataLog) XXX_Merge(src proto.Message) { func (m *LocalDataLog) XXX_Merge(src proto.Message) {
xxx_messageInfo_LocalDataLog.Merge(m, src) xxx_messageInfo_LocalDataLog.Merge(m, src)
} }
func (m *LocalDataLog) XXX_Size() int { func (m *LocalDataLog) XXX_Size() int {
return xxx_messageInfo_LocalDataLog.Size(m) return xxx_messageInfo_LocalDataLog.Size(m)
} }
func (m *LocalDataLog) XXX_DiscardUnknown() { func (m *LocalDataLog) XXX_DiscardUnknown() {
xxx_messageInfo_LocalDataLog.DiscardUnknown(m) xxx_messageInfo_LocalDataLog.DiscardUnknown(m)
} }
......
package util package util
func ToChaincodeArgs(args ...string) [][]byte { func ToChaincodeArgs(args ...string) [][]byte {
bargs := make([][]byte, len(args)) bargs := make([][]byte, len(args))
for i, arg := range args { for i, arg := range args {
bargs[i] = []byte(arg) bargs[i] = []byte(arg)
} }
return bargs return bargs
} }
\ No newline at end of file
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