Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
chain33-sdk-go
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
chain33-sdk-go
Commits
44887f8c
Commit
44887f8c
authored
Nov 08, 2021
by
harrylee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add interchainGet and execute method
parent
659d1455
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
282 additions
and
219 deletions
+282
-219
jsonclient.go
client/jsonclient.go
+74
-7
parse.go
client/parse.go
+108
-0
type.go
client/type.go
+5
-0
broker.go
dapp/broker/broker.go
+4
-0
const.go
dapp/broker/const.go
+3
-3
broker.proto
proto/broker.proto
+69
-50
broker.pb.go
types/broker.pb.go
+0
-0
cert.pb.go
types/cert.pb.go
+4
-27
common.pb.go
types/common.pb.go
+4
-75
sdk.pb.go
types/sdk.pb.go
+7
-18
storage.pb.go
types/storage.pb.go
+0
-0
wasm.pb.go
types/wasm.pb.go
+4
-39
No files found.
client/jsonclient.go
View file @
44887f8c
...
...
@@ -13,6 +13,7 @@ import (
"fmt"
"io/ioutil"
"net/http"
"strconv"
"strings"
"time"
...
...
@@ -317,15 +318,81 @@ func (client *JSONClient) Invoke(requst *Request, privateKey string) (*Response,
}
// TODO 执行请求
func
(
client
*
JSONClient
)
Execute
(
requst
*
Request
)
(
*
Response
,
error
)
{
//err := client.Call(Chain33_QueryTransaction, query, &detail)
//if err != nil {
// return nil, err
//}
//
//return &detail, nil
func
(
client
*
JSONClient
)
Execute
(
requst
*
Request
,
privateKey
string
)
(
*
Response
,
error
)
{
if
requst
.
Exec
==
broker
.
BrokerX
{
switch
requst
.
Fcn
{
case
"invokeInterchain"
:
srcChainServiceID
:=
string
(
requst
.
Args
[
0
])
sequenceNum
,
err
:=
strconv
.
ParseUint
(
string
(
requst
.
Args
[
1
]),
10
,
64
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"cannot parse %s to uint64"
,
string
(
requst
.
Args
[
1
]))
}
targetCID
:=
string
(
requst
.
Args
[
2
])
reqType
,
err
:=
strconv
.
ParseUint
(
string
(
requst
.
Args
[
3
]),
10
,
64
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"cannot parse %s to uint64"
,
string
(
requst
.
Args
[
3
]))
}
if
tx
,
err
:=
broker
.
UpdateIndex
(
""
,
srcChainServiceID
,
targetCID
,
sequenceNum
,
reqType
,
nil
);
err
==
nil
{
resp
,
err
:=
client
.
SendTransactionSync
(
privateKey
,
tx
)
if
err
!=
nil
{
return
resp
,
err
}
//splitedCID[1]就是合约名称
splitedCID
:=
strings
.
Split
(
targetCID
,
"&"
)
if
len
(
splitedCID
)
!=
2
{
return
nil
,
fmt
.
Errorf
(
"Target chaincode id %s is not valid"
,
targetCID
)
}
callFunc
:=
&
CallFunc
{}
if
err
:=
json
.
Unmarshal
(
requst
.
Args
[
4
],
callFunc
);
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"unmarshal call func failed for %s"
,
requst
.
Args
[
4
])
}
// 调用相应链码, (链码名称,参数,通道名称)
if
splitedCID
[
1
]
==
storage
.
StorageX
{
//interchainGet方法是在sdk封装的,用于支持跨链之前数据的查询
switch
callFunc
.
Func
{
case
"interchainGet"
:
return
client
.
InterChainGet
(
string
(
callFunc
.
Args
[
0
]))
}
}
else
{
return
nil
,
fmt
.
Errorf
(
"can't support exec %s"
,
splitedCID
[
1
])
}
}
}
}
return
nil
,
nil
}
//包装适配跨链插件调用
func
(
client
*
JSONClient
)
InterChainSet
(
key
,
value
string
)
(
*
Response
,
error
)
{
return
nil
,
nil
}
//包装适配跨链插件调用
func
(
client
*
JSONClient
)
InterChainGet
(
key
string
)
(
*
Response
,
error
)
{
jsonraw
,
err
:=
json
.
Marshal
(
&
types
.
QueryStorage
{
TxHash
:
key
})
if
err
!=
nil
{
return
nil
,
err
}
query
:=
Query4Jrpc
{
Execer
:
client
.
prefix
+
storage
.
StorageX
,
FuncName
:
storage
.
FuncNameQueryStorage
,
Payload
:
jsonraw
,
}
// var storage types.Storage
data
,
err
:=
client
.
CallBack
(
"Chain33.Query"
,
query
,
ParseStorage
)
if
err
!=
nil
{
return
nil
,
err
}
storage
:=
data
.
(
*
types
.
Storage
)
//这里暂时就去明文存证内容
resp
:=
&
Response
{
OK
:
true
,
Message
:
key
,
Data
:
storage
.
GetContentStorage
()
.
GetContent
()}
return
resp
,
nil
}
// 简单实现交易时间监听功能,后面换成grpc长链接方式监听
func
(
client
*
JSONClient
)
RegisterTxEvent
(
start
int64
,
ccID
,
eventFilter
string
)
(
chan
<-
event
.
Registration
,
<-
chan
*
event
.
CCEvent
,
<-
chan
error
)
{
...
...
client/parse.go
0 → 100644
View file @
44887f8c
package
client
import
(
"encoding/json"
"fmt"
"gitlab.33.cn/link33/chain33-sdk-go/dapp/storage"
"gitlab.33.cn/link33/chain33-sdk-go/types"
.
"github.com/bitly/go-simplejson"
)
// 回调解析函数
func
ParseStorage
(
raw
json
.
RawMessage
)
(
interface
{},
error
)
{
js
,
err
:=
NewJson
(
raw
)
if
err
!=
nil
{
return
nil
,
err
}
if
contentStorge
,
ok
:=
js
.
CheckGet
(
"contentStorage"
);
ok
{
contentHex
,
_
:=
contentStorge
.
Get
(
"content"
)
.
String
()
content
,
_
:=
types
.
FromHex
(
contentHex
)
key
,
_
:=
contentStorge
.
Get
(
"key"
)
.
String
()
value
,
_
:=
contentStorge
.
Get
(
"value"
)
.
String
()
op
,
_
:=
contentStorge
.
Get
(
"op"
)
.
Int
()
storage
:=
&
types
.
Storage
{
Ty
:
storage
.
TyContentStorageAction
,
Value
:
&
types
.
Storage_ContentStorage
{
ContentStorage
:
&
types
.
ContentOnlyNotaryStorage
{
Content
:
content
,
Key
:
key
,
Op
:
int32
(
op
),
Value
:
value
,
XXX_NoUnkeyedLiteral
:
struct
{}{},
XXX_unrecognized
:
nil
,
XXX_sizecache
:
0
,
}}}
return
storage
,
nil
}
if
linkStorge
,
ok
:=
js
.
CheckGet
(
"linkStorage"
);
ok
{
linkHex
,
_
:=
linkStorge
.
Get
(
"link"
)
.
String
()
link
,
_
:=
types
.
FromHex
(
linkHex
)
key
,
_
:=
linkStorge
.
Get
(
"key"
)
.
String
()
value
,
_
:=
linkStorge
.
Get
(
"value"
)
.
String
()
storage
:=
&
types
.
Storage
{
Ty
:
storage
.
TyLinkStorageAction
,
Value
:
&
types
.
Storage_LinkStorage
{
LinkStorage
:
&
types
.
LinkNotaryStorage
{
Link
:
link
,
Key
:
key
,
Value
:
value
,
XXX_NoUnkeyedLiteral
:
struct
{}{},
XXX_unrecognized
:
nil
,
XXX_sizecache
:
0
,
}}}
return
storage
,
nil
}
if
hashStorge
,
ok
:=
js
.
CheckGet
(
"hashStorage"
);
ok
{
hashHex
,
_
:=
hashStorge
.
Get
(
"hash"
)
.
String
()
hash
,
_
:=
types
.
FromHex
(
hashHex
)
key
,
_
:=
hashStorge
.
Get
(
"key"
)
.
String
()
value
,
_
:=
hashStorge
.
Get
(
"value"
)
.
String
()
storage
:=
&
types
.
Storage
{
Ty
:
storage
.
TyHashStorageAction
,
Value
:
&
types
.
Storage_HashStorage
{
HashStorage
:
&
types
.
HashOnlyNotaryStorage
{
Hash
:
hash
,
Key
:
key
,
Value
:
value
,
XXX_NoUnkeyedLiteral
:
struct
{}{},
XXX_unrecognized
:
nil
,
XXX_sizecache
:
0
,
}}}
return
storage
,
nil
}
if
encryptStorage
,
ok
:=
js
.
CheckGet
(
"encryptStorage"
);
ok
{
contentHashHex
,
_
:=
encryptStorage
.
Get
(
"contentHash"
)
.
String
()
contentHash
,
_
:=
types
.
FromHex
(
contentHashHex
)
encryptContentHex
,
_
:=
encryptStorage
.
Get
(
"encryptContent"
)
.
String
()
encryptContent
,
_
:=
types
.
FromHex
(
encryptContentHex
)
nonceHex
,
_
:=
encryptStorage
.
Get
(
"nonce"
)
.
String
()
nonce
,
_
:=
types
.
FromHex
(
nonceHex
)
key
,
_
:=
encryptStorage
.
Get
(
"key"
)
.
String
()
value
,
_
:=
encryptStorage
.
Get
(
"value"
)
.
String
()
storage
:=
&
types
.
Storage
{
Ty
:
storage
.
TyEncryptStorageAction
,
Value
:
&
types
.
Storage_EncryptStorage
{
EncryptStorage
:
&
types
.
EncryptNotaryStorage
{
EncryptContent
:
encryptContent
,
ContentHash
:
contentHash
,
Nonce
:
nonce
,
Key
:
key
,
Value
:
value
,
XXX_NoUnkeyedLiteral
:
struct
{}{},
XXX_unrecognized
:
nil
,
XXX_sizecache
:
0
,
}}}
return
storage
,
nil
}
if
encryptStorage
,
ok
:=
js
.
CheckGet
(
"encryptShareStorage"
);
ok
{
contentHashHex
,
_
:=
encryptStorage
.
Get
(
"contentHash"
)
.
String
()
contentHash
,
_
:=
types
.
FromHex
(
contentHashHex
)
encryptContentHex
,
_
:=
encryptStorage
.
Get
(
"encryptContent"
)
.
String
()
encryptContent
,
_
:=
types
.
FromHex
(
encryptContentHex
)
pubKeyHex
,
_
:=
encryptStorage
.
Get
(
"pubKey"
)
.
String
()
pubKey
,
_
:=
types
.
FromHex
(
pubKeyHex
)
key
,
_
:=
encryptStorage
.
Get
(
"key"
)
.
String
()
value
,
_
:=
encryptStorage
.
Get
(
"value"
)
.
String
()
storage
:=
&
types
.
Storage
{
Ty
:
storage
.
TyEncryptShareStorageAction
,
Value
:
&
types
.
Storage_EncryptShareStorage
{
EncryptShareStorage
:
&
types
.
EncryptShareNotaryStorage
{
EncryptContent
:
encryptContent
,
ContentHash
:
contentHash
,
PubKey
:
pubKey
,
Key
:
key
,
Value
:
value
,
XXX_NoUnkeyedLiteral
:
struct
{}{},
XXX_unrecognized
:
nil
,
XXX_sizecache
:
0
,
}}}
return
storage
,
nil
}
return
nil
,
fmt
.
Errorf
(
"unknow type!"
)
}
client/type.go
View file @
44887f8c
...
...
@@ -360,3 +360,8 @@ type Response struct {
Message
string
`json:"message"`
Data
[]
byte
`json:"data"`
}
type
CallFunc
struct
{
Func
string
`json:"func"`
Args
[][]
byte
`json:"args"`
}
dapp/broker/broker.go
View file @
44887f8c
...
...
@@ -51,3 +51,7 @@ func UpdateIndex(paraName, srcServiceID, dstServiceID string, sequenceNum, reqTy
return
tx
,
nil
}
}
func
EmitInterchainSetEvent
(){
}
dapp/broker/const.go
View file @
44887f8c
...
...
@@ -3,13 +3,13 @@ package broker
const
(
TyUnknowAction
=
iota
+
100
TyInitAction
TyRegisterAction
TyRegister
Exector
Action
TyAuditAction
TyUpdateIndexAction
TyEmitInterchainEventAction
NameInitAction
=
"Init"
NameRegister
Action
=
"Registe
r"
NameRegister
ExectorAction
=
"RegisterExecto
r"
NameAuditAction
=
"Audit"
NameUpdateIndexAction
=
"UpdateIndex"
NameEmitInterchainEventAction
=
"EmitInterchainEvent"
...
...
@@ -31,7 +31,7 @@ const Addr = "1MCftFynyvG2F4ED5mdHYgziDxx6vDrScs"
// 定义actionMap
var
ActionMap
=
map
[
string
]
int32
{
NameInitAction
:
TyInitAction
,
NameRegister
Action
:
TyRegiste
rAction
,
NameRegister
ExectorAction
:
TyRegisterExecto
rAction
,
NameAuditAction
:
TyAuditAction
,
NameUpdateIndexAction
:
TyUpdateIndexAction
,
NameEmitInterchainEventAction
:
TyEmitInterchainEventAction
,
...
...
proto/broker.proto
View file @
44887f8c
syntax
=
"proto3"
;
package
types
;
//
option go_package = "../types";
//option go_package = "../types";
message
BrokerAction
{
oneof
value
{
Register
register
=
1
;
Audit
audit
=
2
;
InterchainEvent
emitInterchainEvent
=
3
;
UpdateIndex
updateIndex
=
4
;
Init
init
=
1
;
RegisterExector
registerExector
=
2
;
Audit
audit
=
3
;
InterchainEvent
emitInterchainEvent
=
4
;
UpdateIndex
updateIndex
=
5
;
}
int32
ty
=
5
;
int32
ty
=
6
;
}
//broker初始化信息
message
Init
{
string
bxhId
=
1
;
string
appChainId
=
2
;
}
// 业务合约注册模型: 0表示正在审核,1表示审核通过,2表示审核失败
message
Register
{
message
Register
Exector
{
//业务合约名称
string
exectorName
=
1
;
}
//审核
message
Audit
{
//业务合约名称
//业务合约名称
string
exectorName
=
1
;
//状态码 0表示正在审核,1表示审核通过,2表示审核失败
//状态码 0表示正在审核,1表示审核通过,2表示审核失败
string
status
=
2
;
}
// 轮循事件
message
PollingEvent
{
Meta
meta
=
1
;
Meta
meta
=
1
;
}
// 更新跨链事件索引
message
UpdateIndex
{
//当前链已经处理到的位置
uint64
sequenceNum
=
1
;
uint64
sequenceNum
=
1
;
//目的链服务ID,固定格式0x000001
string
dstServiceID
=
2
;
string
dstServiceID
=
2
;
//源链ID,固定格式0x000002
string
srcServiceID
=
3
;
string
srcServiceID
=
3
;
//请求类型 0表示信息流入 1表示信息流出 2表示回滚
uint64
reqType
=
4
;
uint64
reqType
=
4
;
//响应信息
Response
response
=
5
;
Response
response
=
5
;
}
// 跨链事件
message
InterchainEvent
{
//索引值,这个有系统自动生成
uint64
index
=
1
;
uint64
index
=
1
;
//目的链ID,固定格式0x000001
string
dstServiceID
=
2
;
string
dstServiceID
=
2
;
//源链ID,固定格式0x000002
string
srcServiceID
=
3
;
string
srcServiceID
=
3
;
//跨链交易类型 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表示跨链失败
int32
status
=
7
;
int32
status
=
7
;
}
//
ReceiptBrokerLog
message
ReceiptBrokerLog
{
//ReceiptBrokerLog
message
ReceiptBrokerLog
{
oneof
value
{
Register
register
=
1
;
Audit
audit
=
2
;
Register
Exector
registerExector
=
1
;
Audit
audit
=
2
;
InterchainEvent
emitInterchainEvent
=
3
;
UpdateIndex
updateIndex
=
4
;
UpdateIndex
updateIndex
=
4
;
}
int32
ty
=
5
;
}
service
broker
{}
//查询跨出事件
message
QueryInterchainEvent
{
uint64
index
=
1
;
message
QueryInterchainEvent
{
uint64
index
=
1
;
//目的链ID,固定格式0x000001
string
dstServiceID
=
2
;
string
dstServiceID
=
2
;
//源链ID,固定格式0x000002
string
srcServiceID
=
3
;
string
srcServiceID
=
3
;
}
//跨链事件列表
message
InterChainEventList
{
repeated
InterchainEvent
list
=
1
;
message
InterChainEventList
{
repeated
InterchainEvent
list
=
1
;
}
////根据状态查看跨链事件
//
message QueryInterchainEventList {
//message QueryInterchainEventList {
// //事件状态必填(默认是0,只查询待处理状态的事件)
// int32 status = 1;
// // 主键索引
...
...
@@ -97,40 +107,50 @@ message InterChainEventList {
// int32 direction = 4;
//}
////跨链事件列表
//
message InterchainEventList {
//message InterchainEventList {
// repeated InterchainEvent list = 1;
// string primaryKey = 2;
//}
message
QueryOutterMeta
{}
message
QueryInnerMeta
{}
message
QueryNilParam
{}
message
QueryNilParam
{
}
message
QueryOutterMeta
{
message
QueryInMessage
{
string
inServicePair
=
1
;
uint64
sequenceNum
=
2
;
}
message
QueryOutMessage
{
message
QueryInnerMeta
{
}
message
QueryInMessage
{
string
inServicePair
=
1
;
uint64
sequenceNum
=
2
;
uint64
sequenceNum
=
2
;
}
message
Meta
{
map
<
string
,
uint64
>
meta
=
1
;
message
QueryOutMessage
{
string
inServicePair
=
1
;
uint64
sequenceNum
=
2
;
}
message
BrokerInfo
{
//跨链协议版本ID
string
bxhId
=
1
;
string
bxhId
=
1
;
//应用链ID
string
appChainId
=
2
;
}
message
Response
{
message
Meta
{
map
<
string
,
uint64
>
meta
=
1
;
}
message
Response
{
// A status code that should follow the HTTP status codes.
int32
status
=
1
;
// A message associated with the response code.
string
message
=
2
;
// A payload that can be used to include metadata with this response.
bytes
payload
=
3
;
}
\ No newline at end of file
bytes
payload
=
3
;
}
types/broker.pb.go
View file @
44887f8c
This diff is collapsed.
Click to expand it.
types/cert.pb.go
View file @
44887f8c
...
...
@@ -5,17 +5,14 @@ package types
import
(
fmt
"fmt"
math
"math"
proto
"github.com/golang/protobuf/proto"
math
"math"
)
// Reference imports to suppress errors if they are not otherwise used.
var
(
_
=
proto
.
Marshal
_
=
fmt
.
Errorf
_
=
math
.
Inf
)
var
_
=
proto
.
Marshal
var
_
=
fmt
.
Errorf
var
_
=
math
.
Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
...
...
@@ -46,19 +43,15 @@ func (*CertAction) Descriptor() ([]byte, []int) {
func
(
m
*
CertAction
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
return
xxx_messageInfo_CertAction
.
Unmarshal
(
m
,
b
)
}
func
(
m
*
CertAction
)
XXX_Marshal
(
b
[]
byte
,
deterministic
bool
)
([]
byte
,
error
)
{
return
xxx_messageInfo_CertAction
.
Marshal
(
b
,
m
,
deterministic
)
}
func
(
m
*
CertAction
)
XXX_Merge
(
src
proto
.
Message
)
{
xxx_messageInfo_CertAction
.
Merge
(
m
,
src
)
}
func
(
m
*
CertAction
)
XXX_Size
()
int
{
return
xxx_messageInfo_CertAction
.
Size
(
m
)
}
func
(
m
*
CertAction
)
XXX_DiscardUnknown
()
{
xxx_messageInfo_CertAction
.
DiscardUnknown
(
m
)
}
...
...
@@ -150,19 +143,15 @@ func (*CertNew) Descriptor() ([]byte, []int) {
func
(
m
*
CertNew
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
return
xxx_messageInfo_CertNew
.
Unmarshal
(
m
,
b
)
}
func
(
m
*
CertNew
)
XXX_Marshal
(
b
[]
byte
,
deterministic
bool
)
([]
byte
,
error
)
{
return
xxx_messageInfo_CertNew
.
Marshal
(
b
,
m
,
deterministic
)
}
func
(
m
*
CertNew
)
XXX_Merge
(
src
proto
.
Message
)
{
xxx_messageInfo_CertNew
.
Merge
(
m
,
src
)
}
func
(
m
*
CertNew
)
XXX_Size
()
int
{
return
xxx_messageInfo_CertNew
.
Size
(
m
)
}
func
(
m
*
CertNew
)
XXX_DiscardUnknown
()
{
xxx_messageInfo_CertNew
.
DiscardUnknown
(
m
)
}
...
...
@@ -202,19 +191,15 @@ func (*CertUpdate) Descriptor() ([]byte, []int) {
func
(
m
*
CertUpdate
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
return
xxx_messageInfo_CertUpdate
.
Unmarshal
(
m
,
b
)
}
func
(
m
*
CertUpdate
)
XXX_Marshal
(
b
[]
byte
,
deterministic
bool
)
([]
byte
,
error
)
{
return
xxx_messageInfo_CertUpdate
.
Marshal
(
b
,
m
,
deterministic
)
}
func
(
m
*
CertUpdate
)
XXX_Merge
(
src
proto
.
Message
)
{
xxx_messageInfo_CertUpdate
.
Merge
(
m
,
src
)
}
func
(
m
*
CertUpdate
)
XXX_Size
()
int
{
return
xxx_messageInfo_CertUpdate
.
Size
(
m
)
}
func
(
m
*
CertUpdate
)
XXX_DiscardUnknown
()
{
xxx_messageInfo_CertUpdate
.
DiscardUnknown
(
m
)
}
...
...
@@ -254,19 +239,15 @@ func (*CertNormal) Descriptor() ([]byte, []int) {
func
(
m
*
CertNormal
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
return
xxx_messageInfo_CertNormal
.
Unmarshal
(
m
,
b
)
}
func
(
m
*
CertNormal
)
XXX_Marshal
(
b
[]
byte
,
deterministic
bool
)
([]
byte
,
error
)
{
return
xxx_messageInfo_CertNormal
.
Marshal
(
b
,
m
,
deterministic
)
}
func
(
m
*
CertNormal
)
XXX_Merge
(
src
proto
.
Message
)
{
xxx_messageInfo_CertNormal
.
Merge
(
m
,
src
)
}
func
(
m
*
CertNormal
)
XXX_Size
()
int
{
return
xxx_messageInfo_CertNormal
.
Size
(
m
)
}
func
(
m
*
CertNormal
)
XXX_DiscardUnknown
()
{
xxx_messageInfo_CertNormal
.
DiscardUnknown
(
m
)
}
...
...
@@ -306,19 +287,15 @@ func (*CertSignature) Descriptor() ([]byte, []int) {
func
(
m
*
CertSignature
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
return
xxx_messageInfo_CertSignature
.
Unmarshal
(
m
,
b
)
}
func
(
m
*
CertSignature
)
XXX_Marshal
(
b
[]
byte
,
deterministic
bool
)
([]
byte
,
error
)
{
return
xxx_messageInfo_CertSignature
.
Marshal
(
b
,
m
,
deterministic
)
}
func
(
m
*
CertSignature
)
XXX_Merge
(
src
proto
.
Message
)
{
xxx_messageInfo_CertSignature
.
Merge
(
m
,
src
)
}
func
(
m
*
CertSignature
)
XXX_Size
()
int
{
return
xxx_messageInfo_CertSignature
.
Size
(
m
)
}
func
(
m
*
CertSignature
)
XXX_DiscardUnknown
()
{
xxx_messageInfo_CertSignature
.
DiscardUnknown
(
m
)
}
...
...
types/common.pb.go
View file @
44887f8c
This diff is collapsed.
Click to expand it.
types/sdk.pb.go
View file @
44887f8c
...
...
@@ -5,17 +5,14 @@ package types
import
(
fmt
"fmt"
math
"math"
proto
"github.com/golang/protobuf/proto"
math
"math"
)
// Reference imports to suppress errors if they are not otherwise used.
var
(
_
=
proto
.
Marshal
_
=
fmt
.
Errorf
_
=
math
.
Inf
)
var
_
=
proto
.
Marshal
var
_
=
fmt
.
Errorf
var
_
=
math
.
Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
...
...
@@ -29,9 +26,9 @@ type Transaction struct {
Signature
*
Signature
`protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,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"`
//
随机ID,可以防止payload 相同的时候,交易重复
//随机ID,可以防止payload 相同的时候,交易重复
Nonce
int64
`protobuf:"varint,6,opt,name=nonce,proto3" json:"nonce,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"`
Header
[]
byte
`protobuf:"bytes,9,opt,name=header,proto3" json:"header,omitempty"`
...
...
@@ -51,19 +48,15 @@ func (*Transaction) Descriptor() ([]byte, []int) {
func
(
m
*
Transaction
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
return
xxx_messageInfo_Transaction
.
Unmarshal
(
m
,
b
)
}
func
(
m
*
Transaction
)
XXX_Marshal
(
b
[]
byte
,
deterministic
bool
)
([]
byte
,
error
)
{
return
xxx_messageInfo_Transaction
.
Marshal
(
b
,
m
,
deterministic
)
}
func
(
m
*
Transaction
)
XXX_Merge
(
src
proto
.
Message
)
{
xxx_messageInfo_Transaction
.
Merge
(
m
,
src
)
}
func
(
m
*
Transaction
)
XXX_Size
()
int
{
return
xxx_messageInfo_Transaction
.
Size
(
m
)
}
func
(
m
*
Transaction
)
XXX_DiscardUnknown
()
{
xxx_messageInfo_Transaction
.
DiscardUnknown
(
m
)
}
...
...
@@ -143,7 +136,7 @@ func (m *Transaction) GetNext() []byte {
type
Signature
struct
{
Ty
int32
`protobuf:"varint,1,opt,name=ty,proto3" json:"ty,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"`
XXX_NoUnkeyedLiteral
struct
{}
`json:"-"`
XXX_unrecognized
[]
byte
`json:"-"`
...
...
@@ -160,19 +153,15 @@ func (*Signature) Descriptor() ([]byte, []int) {
func
(
m
*
Signature
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
return
xxx_messageInfo_Signature
.
Unmarshal
(
m
,
b
)
}
func
(
m
*
Signature
)
XXX_Marshal
(
b
[]
byte
,
deterministic
bool
)
([]
byte
,
error
)
{
return
xxx_messageInfo_Signature
.
Marshal
(
b
,
m
,
deterministic
)
}
func
(
m
*
Signature
)
XXX_Merge
(
src
proto
.
Message
)
{
xxx_messageInfo_Signature
.
Merge
(
m
,
src
)
}
func
(
m
*
Signature
)
XXX_Size
()
int
{
return
xxx_messageInfo_Signature
.
Size
(
m
)
}
func
(
m
*
Signature
)
XXX_DiscardUnknown
()
{
xxx_messageInfo_Signature
.
DiscardUnknown
(
m
)
}
...
...
types/storage.pb.go
View file @
44887f8c
This diff is collapsed.
Click to expand it.
types/wasm.pb.go
View file @
44887f8c
...
...
@@ -5,17 +5,14 @@ package types
import
(
fmt
"fmt"
math
"math"
proto
"github.com/golang/protobuf/proto"
math
"math"
)
// Reference imports to suppress errors if they are not otherwise used.
var
(
_
=
proto
.
Marshal
_
=
fmt
.
Errorf
_
=
math
.
Inf
)
var
_
=
proto
.
Marshal
var
_
=
fmt
.
Errorf
var
_
=
math
.
Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
...
...
@@ -44,19 +41,15 @@ func (*WasmAction) Descriptor() ([]byte, []int) {
func
(
m
*
WasmAction
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
return
xxx_messageInfo_WasmAction
.
Unmarshal
(
m
,
b
)
}
func
(
m
*
WasmAction
)
XXX_Marshal
(
b
[]
byte
,
deterministic
bool
)
([]
byte
,
error
)
{
return
xxx_messageInfo_WasmAction
.
Marshal
(
b
,
m
,
deterministic
)
}
func
(
m
*
WasmAction
)
XXX_Merge
(
src
proto
.
Message
)
{
xxx_messageInfo_WasmAction
.
Merge
(
m
,
src
)
}
func
(
m
*
WasmAction
)
XXX_Size
()
int
{
return
xxx_messageInfo_WasmAction
.
Size
(
m
)
}
func
(
m
*
WasmAction
)
XXX_DiscardUnknown
()
{
xxx_messageInfo_WasmAction
.
DiscardUnknown
(
m
)
}
...
...
@@ -133,19 +126,15 @@ func (*WasmCreate) Descriptor() ([]byte, []int) {
func
(
m
*
WasmCreate
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
return
xxx_messageInfo_WasmCreate
.
Unmarshal
(
m
,
b
)
}
func
(
m
*
WasmCreate
)
XXX_Marshal
(
b
[]
byte
,
deterministic
bool
)
([]
byte
,
error
)
{
return
xxx_messageInfo_WasmCreate
.
Marshal
(
b
,
m
,
deterministic
)
}
func
(
m
*
WasmCreate
)
XXX_Merge
(
src
proto
.
Message
)
{
xxx_messageInfo_WasmCreate
.
Merge
(
m
,
src
)
}
func
(
m
*
WasmCreate
)
XXX_Size
()
int
{
return
xxx_messageInfo_WasmCreate
.
Size
(
m
)
}
func
(
m
*
WasmCreate
)
XXX_DiscardUnknown
()
{
xxx_messageInfo_WasmCreate
.
DiscardUnknown
(
m
)
}
...
...
@@ -186,19 +175,15 @@ func (*WasmCall) Descriptor() ([]byte, []int) {
func
(
m
*
WasmCall
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
return
xxx_messageInfo_WasmCall
.
Unmarshal
(
m
,
b
)
}
func
(
m
*
WasmCall
)
XXX_Marshal
(
b
[]
byte
,
deterministic
bool
)
([]
byte
,
error
)
{
return
xxx_messageInfo_WasmCall
.
Marshal
(
b
,
m
,
deterministic
)
}
func
(
m
*
WasmCall
)
XXX_Merge
(
src
proto
.
Message
)
{
xxx_messageInfo_WasmCall
.
Merge
(
m
,
src
)
}
func
(
m
*
WasmCall
)
XXX_Size
()
int
{
return
xxx_messageInfo_WasmCall
.
Size
(
m
)
}
func
(
m
*
WasmCall
)
XXX_DiscardUnknown
()
{
xxx_messageInfo_WasmCall
.
DiscardUnknown
(
m
)
}
...
...
@@ -250,19 +235,15 @@ func (*QueryCheckContract) Descriptor() ([]byte, []int) {
func
(
m
*
QueryCheckContract
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
return
xxx_messageInfo_QueryCheckContract
.
Unmarshal
(
m
,
b
)
}
func
(
m
*
QueryCheckContract
)
XXX_Marshal
(
b
[]
byte
,
deterministic
bool
)
([]
byte
,
error
)
{
return
xxx_messageInfo_QueryCheckContract
.
Marshal
(
b
,
m
,
deterministic
)
}
func
(
m
*
QueryCheckContract
)
XXX_Merge
(
src
proto
.
Message
)
{
xxx_messageInfo_QueryCheckContract
.
Merge
(
m
,
src
)
}
func
(
m
*
QueryCheckContract
)
XXX_Size
()
int
{
return
xxx_messageInfo_QueryCheckContract
.
Size
(
m
)
}
func
(
m
*
QueryCheckContract
)
XXX_DiscardUnknown
()
{
xxx_messageInfo_QueryCheckContract
.
DiscardUnknown
(
m
)
}
...
...
@@ -293,19 +274,15 @@ func (*CustomLog) Descriptor() ([]byte, []int) {
func
(
m
*
CustomLog
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
return
xxx_messageInfo_CustomLog
.
Unmarshal
(
m
,
b
)
}
func
(
m
*
CustomLog
)
XXX_Marshal
(
b
[]
byte
,
deterministic
bool
)
([]
byte
,
error
)
{
return
xxx_messageInfo_CustomLog
.
Marshal
(
b
,
m
,
deterministic
)
}
func
(
m
*
CustomLog
)
XXX_Merge
(
src
proto
.
Message
)
{
xxx_messageInfo_CustomLog
.
Merge
(
m
,
src
)
}
func
(
m
*
CustomLog
)
XXX_Size
()
int
{
return
xxx_messageInfo_CustomLog
.
Size
(
m
)
}
func
(
m
*
CustomLog
)
XXX_DiscardUnknown
()
{
xxx_messageInfo_CustomLog
.
DiscardUnknown
(
m
)
}
...
...
@@ -337,19 +314,15 @@ func (*CreateContractLog) Descriptor() ([]byte, []int) {
func
(
m
*
CreateContractLog
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
return
xxx_messageInfo_CreateContractLog
.
Unmarshal
(
m
,
b
)
}
func
(
m
*
CreateContractLog
)
XXX_Marshal
(
b
[]
byte
,
deterministic
bool
)
([]
byte
,
error
)
{
return
xxx_messageInfo_CreateContractLog
.
Marshal
(
b
,
m
,
deterministic
)
}
func
(
m
*
CreateContractLog
)
XXX_Merge
(
src
proto
.
Message
)
{
xxx_messageInfo_CreateContractLog
.
Merge
(
m
,
src
)
}
func
(
m
*
CreateContractLog
)
XXX_Size
()
int
{
return
xxx_messageInfo_CreateContractLog
.
Size
(
m
)
}
func
(
m
*
CreateContractLog
)
XXX_DiscardUnknown
()
{
xxx_messageInfo_CreateContractLog
.
DiscardUnknown
(
m
)
}
...
...
@@ -389,19 +362,15 @@ func (*CallContractLog) Descriptor() ([]byte, []int) {
func
(
m
*
CallContractLog
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
return
xxx_messageInfo_CallContractLog
.
Unmarshal
(
m
,
b
)
}
func
(
m
*
CallContractLog
)
XXX_Marshal
(
b
[]
byte
,
deterministic
bool
)
([]
byte
,
error
)
{
return
xxx_messageInfo_CallContractLog
.
Marshal
(
b
,
m
,
deterministic
)
}
func
(
m
*
CallContractLog
)
XXX_Merge
(
src
proto
.
Message
)
{
xxx_messageInfo_CallContractLog
.
Merge
(
m
,
src
)
}
func
(
m
*
CallContractLog
)
XXX_Size
()
int
{
return
xxx_messageInfo_CallContractLog
.
Size
(
m
)
}
func
(
m
*
CallContractLog
)
XXX_DiscardUnknown
()
{
xxx_messageInfo_CallContractLog
.
DiscardUnknown
(
m
)
}
...
...
@@ -447,19 +416,15 @@ func (*LocalDataLog) Descriptor() ([]byte, []int) {
func
(
m
*
LocalDataLog
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
return
xxx_messageInfo_LocalDataLog
.
Unmarshal
(
m
,
b
)
}
func
(
m
*
LocalDataLog
)
XXX_Marshal
(
b
[]
byte
,
deterministic
bool
)
([]
byte
,
error
)
{
return
xxx_messageInfo_LocalDataLog
.
Marshal
(
b
,
m
,
deterministic
)
}
func
(
m
*
LocalDataLog
)
XXX_Merge
(
src
proto
.
Message
)
{
xxx_messageInfo_LocalDataLog
.
Merge
(
m
,
src
)
}
func
(
m
*
LocalDataLog
)
XXX_Size
()
int
{
return
xxx_messageInfo_LocalDataLog
.
Size
(
m
)
}
func
(
m
*
LocalDataLog
)
XXX_DiscardUnknown
()
{
xxx_messageInfo_LocalDataLog
.
DiscardUnknown
(
m
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment