Commit 3708a25d authored by suyanlong's avatar suyanlong

add todo and make pb

parent aeda6e51
......@@ -151,7 +151,7 @@ func (a *appChain) applyReceiptIBTP(ibtp *pb.IBTP) error {
var err error
if pd.Encrypted {
// TODO
// TODO fix bug about mode value
contentByte, err = a.cryptor.Decrypt(contentByte, ibtp.To, repo.DirectMode)
if err != nil {
return fmt.Errorf("decrypt ibtp payload content: %w", err)
......@@ -342,6 +342,7 @@ func (a *appChain) encryption(ibtp *pb.IBTP) error {
return nil
}
// TODO fix bug about mode value
ctb, err := a.cryptor.Encrypt(pld.Content, ibtp.To, repo.DirectMode)
if err != nil {
return err
......
......@@ -64,6 +64,7 @@ func (d *cryptor) getDesKey(address string, mode string) (crypto.SymmetricKey, e
}
}
if mode == repo.RelayMode {
//TODO fix bug
rp, err := d.client.InvokeBVMContract(constant.AppchainMgrContractAddr.Address(), "GetPubKeyByChainID", nil, rpcx.String(address))
if err != nil {
return nil, err
......
......@@ -13,11 +13,11 @@ import (
)
// 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.
......
......@@ -13,11 +13,11 @@ import (
)
// 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.
......
......@@ -13,11 +13,11 @@ import (
)
// 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.
......
......@@ -8,8 +8,9 @@ import "ibtp.proto";
message IBTPX {
IBTP ibtp = 1;
// route mode
string mode = 2; // dirct、relay
repeated string routeSign = 3; //路由节点签名路径,主要是对data hash签名,主要是相互校验。sidecar节点之间相互校验。sidecar 节点需要注册到中继连上。还可以过滤已经发送过的交易、也可以作恶惩罚。使用bls签名算法,聚合签名。
string mode = 2; // dirct、relay
repeated string routeSign =
3; //路由节点签名路径,主要是对data hash签名,主要是相互校验。sidecar节点之间相互校验。sidecar 节点需要注册到中继连上。还可以过滤已经发送过的交易、也可以作恶惩罚。使用bls签名算法,聚合签名。
string routeMethod = 4; // single、multicast、broadcast、
repeated string routeMethodArg = 5; //路由节点,默认第一个节点。或者转发消息。
bool IsValid = 6;
......
......@@ -13,11 +13,11 @@ import (
)
// 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.
......@@ -35,7 +35,7 @@ const (
Message_APPCHAIN_GET Message_Type = 4
Message_INTERCHAIN_META_GET Message_Type = 5
Message_RULE_DEPLOY Message_Type = 6
// 异步完成
//异步完成
Message_IBTP_GET Message_Type = 7
Message_IBTP_SEND Message_Type = 8
Message_IBTP_RECEIPT_SEND Message_Type = 9
......
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