Commit 63b4edbf authored by hezhengjun's avatar hezhengjun

change the way to get lock tx

parent e7901f80
......@@ -67,10 +67,11 @@ func (e *evmxgo) Exec_Mint(payload *evmxgotypes.EvmxgoMint, tx *types.Transactio
if nil != err {
return nil, err
}
if len(txGroup) < 2 {
if len(txGroup) < 2 || index == 0 {
return nil, errors.New("Mint tx should be included in lock tx group")
}
return action.mint(payload, txGroup[0])
txs := e.GetTxs()
return action.mint(payload, txs[index-1])
}
func (e *evmxgo) Exec_Burn(payload *evmxgotypes.EvmxgoBurn, tx *types.Transaction, index int) (*types.Receipt, error) {
......
......@@ -166,8 +166,8 @@ type EvmxgoMint struct {
Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"`
Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"`
Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"`
BridgeToken string `protobuf:"bytes,3,opt,name=bridgeToken,proto3" json:"bridgeToken,omitempty"`
Recipient string `protobuf:"bytes,4,opt,name=recipient,proto3" json:"recipient,omitempty"`
}
func (x *EvmxgoMint) Reset() {
......@@ -216,16 +216,16 @@ func (x *EvmxgoMint) GetAmount() int64 {
return 0
}
func (x *EvmxgoMint) GetAddress() string {
func (x *EvmxgoMint) GetBridgeToken() string {
if x != nil {
return x.Address
return x.BridgeToken
}
return ""
}
func (x *EvmxgoMint) GetToken() string {
func (x *EvmxgoMint) GetRecipient() string {
if x != nil {
return x.Token
return x.Recipient
}
return ""
}
......@@ -1323,14 +1323,15 @@ var file_evmxgo_proto_rawDesc = []byte{
0x32, 0x11, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x76, 0x6d, 0x78, 0x67, 0x6f, 0x42,
0x75, 0x72, 0x6e, 0x48, 0x00, 0x52, 0x04, 0x62, 0x75, 0x72, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x54,
0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x54, 0x79, 0x42, 0x07, 0x0a, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x22, 0x6c, 0x0a, 0x0a, 0x45, 0x76, 0x6d, 0x78, 0x67, 0x6f, 0x4d, 0x69,
0x61, 0x6c, 0x75, 0x65, 0x22, 0x7c, 0x0a, 0x0a, 0x45, 0x76, 0x6d, 0x78, 0x67, 0x6f, 0x4d, 0x69,
0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d,
0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75,
0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05,
0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b,
0x65, 0x6e, 0x22, 0x3c, 0x0a, 0x0a, 0x45, 0x76, 0x6d, 0x78, 0x67, 0x6f, 0x42, 0x75, 0x72, 0x6e,
0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65,
0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x54,
0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e,
0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65,
0x6e, 0x74, 0x22, 0x3c, 0x0a, 0x0a, 0x45, 0x76, 0x6d, 0x78, 0x67, 0x6f, 0x42, 0x75, 0x72, 0x6e,
0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75,
0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74,
......
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