Commit 9b3b4c2a authored by libangzhu's avatar libangzhu

Merge branch 'withdraw_opt_1217' of github.com:zhengjunhe/plugin into HEAD

parents b0ede901 832075c0
......@@ -181,10 +181,10 @@ contract BridgeBank is EthereumBank, Chain33Bank {
)
public
{
return burnEthereumTokens(
return withdrawEthereumTokens(
msg.sender,
_ethereumReceiver,
_ethereumTokenAddress,
_bridgeTokenAddress,
_amount
);
}
......
......@@ -232,6 +232,7 @@ contract EthereumBank {
bridgeTokenCreated[symHash] = true;
depositBurnWithdrawCounts[newBridgeTokenAddress] = DepositBurnWithdrawCount(
uint256(0),
uint256(0),
uint256(0));
token2address[symHash] = newBridgeTokenAddress;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -51,6 +51,7 @@ func EthereumRelayerCmd() *cobra.Command {
MultiSignEthCmd(),
TransferEthCmd(),
ConfigplatformTokenSymbolCmd(),
CfgWithdrawCmd(),
)
return cmd
......@@ -1187,3 +1188,35 @@ func SetEthMultiSignAddr(cmd *cobra.Command, _ []string) {
ctx := jsonclient.NewRPCCtx(rpcLaddr, "Manager.SetEthMultiSignAddr", address, &res)
ctx.Run()
}
func CfgWithdrawCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "cfgWithdraw",
Short: "cfg withdraw fee",
Run: CfgWithdraw,
}
addCfgWithdrawFlags(cmd)
return cmd
}
func addCfgWithdrawFlags(cmd *cobra.Command) {
cmd.Flags().StringP("symbol", "s", "", "symbol")
_ = cmd.MarkFlagRequired("symbol")
cmd.Flags().Int64P("fee", "f", 0, "fee amount")
_ = cmd.MarkFlagRequired("fee")
}
func CfgWithdraw(cmd *cobra.Command, _ []string) {
rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr")
symbol, _ := cmd.Flags().GetString("symbol")
fee, _ := cmd.Flags().GetInt64("fee")
req := &ebTypes.CfgWithdrawReq{
Symbol: symbol,
FeeAmount: fee,
}
var res rpctypes.Reply
ctx := jsonclient.NewRPCCtx(rpcLaddr, "Manager.CfgWithdraw", req, &res)
ctx.Run()
}
......@@ -246,3 +246,14 @@ message ResendChain33EventReq {
int64 height = 1;
}
message CfgWithdrawReq {
string symbol = 1;
int64 feeAmount = 2;
}
message WithdrawSymbol2Fee {
map<string, int64> symbol2Fee = 1;
}
......@@ -77,6 +77,7 @@ type Relayer4Ethereum struct {
symbol2Addr map[string]common.Address
symbol2LockAddr map[string]ebTypes.TokenAddress
mulSignAddr string
withdrawFee map[string]int64
}
var (
......@@ -134,6 +135,7 @@ func StartEthereumRelayer(startPara *EthereumStartPara) *Relayer4Ethereum {
ethRelayer.eventLogIndex = ethRelayer.getLastBridgeBankProcessedHeight()
ethRelayer.initBridgeBankTx()
ethRelayer.mulSignAddr = ethRelayer.getMultiSignAddress()
ethRelayer.withdrawFee = ethRelayer.restoreWithdrawFee()
// Start clientSpec with infura ropsten provider
relayerLog.Info("Relayer4Ethereum proc", "Started Ethereum websocket with provider:", ethRelayer.provider)
......@@ -1245,3 +1247,11 @@ func (ethRelayer *Relayer4Ethereum) SetMultiSignAddr(address string) {
ethRelayer.setMultiSignAddress(address)
}
func (ethRelayer *Relayer4Ethereum) CfgWithdraw(symbol string, feeAmount int64) error {
ethRelayer.rwLock.Lock()
ethRelayer.withdrawFee[symbol] = feeAmount
ethRelayer.rwLock.Unlock()
return ethRelayer.setWithdrawFee(ethRelayer.withdrawFee)
}
......@@ -27,6 +27,7 @@ var (
ethLockTxUpdateTxIndex = []byte("eth-ethLockTxUpdateTxIndex")
ethBurnTxUpdateTxIndex = []byte("eth-ethBurnTxUpdateTxIndex")
multiSignAddressPrefix = []byte("eth-multiSignAddress")
withdrawFeeKey = []byte("eth-withdrawFee")
)
func ethTokenSymbol2AddrKey(symbol string) []byte {
......@@ -383,3 +384,28 @@ func (ethRelayer *Relayer4Ethereum) getMultiSignAddress() string {
}
return string(bytes)
}
func (ethRelayer *Relayer4Ethereum) setWithdrawFee(symbol2Fee map[string]int64) error {
withdrawSymbol2Fee := &ebTypes.WithdrawSymbol2Fee{
Symbol2Fee: symbol2Fee,
}
bytes := chain33Types.Encode(withdrawSymbol2Fee)
return ethRelayer.db.Set(withdrawFeeKey, bytes)
}
func (ethRelayer *Relayer4Ethereum) restoreWithdrawFee() map[string]int64 {
bytes, _ := ethRelayer.db.Get(withdrawFeeKey)
if 0 == len(bytes) {
result := make(map[string]int64)
return result
}
var withdrawSymbol2Fee ebTypes.WithdrawSymbol2Fee
if err := chain33Types.Decode(bytes, &withdrawSymbol2Fee); nil != err {
result := make(map[string]int64)
return result
}
return withdrawSymbol2Fee.Symbol2Fee
}
......@@ -1102,3 +1102,20 @@ func (manager *Manager) SetEthMultiSignAddr(multiSignAddr string, result *interf
}
return nil
}
func (manager *Manager) CfgWithdraw(cfgWithdrawReq *relayerTypes.CfgWithdrawReq, result *interface{}) error {
manager.mtx.Lock()
defer manager.mtx.Unlock()
if err := manager.checkPermission(); nil != err {
return err
}
err := manager.ethRelayer.CfgWithdraw(cfgWithdrawReq.Symbol, cfgWithdrawReq.FeeAmount)
resultCfg := true
if err != nil {
resultCfg = false
}
*result = rpctypes.Reply{
IsOk: resultCfg,
}
return nil
}
......@@ -7,12 +7,11 @@
package types
import (
reflect "reflect"
sync "sync"
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
......@@ -307,6 +306,7 @@ type RelayerConfig struct {
BridgeRegistryOnChain33 string `protobuf:"bytes,12,opt,name=bridgeRegistryOnChain33,proto3" json:"bridgeRegistryOnChain33,omitempty"`
ChainName string `protobuf:"bytes,13,opt,name=chainName,proto3" json:"chainName,omitempty"`
ChainID4Chain33 int32 `protobuf:"varint,14,opt,name=chainID4Chain33,proto3" json:"chainID4Chain33,omitempty"`
ProcessWithDraw bool `protobuf:"varint,15,opt,name=processWithDraw,proto3" json:"processWithDraw,omitempty"`
}
func (x *RelayerConfig) Reset() {
......@@ -439,6 +439,13 @@ func (x *RelayerConfig) GetChainID4Chain33() int32 {
return 0
}
func (x *RelayerConfig) GetProcessWithDraw() bool {
if x != nil {
return x.ProcessWithDraw
}
return false
}
type SyncTxReceiptConfig struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
......@@ -670,7 +677,7 @@ var file_config_proto_rawDesc = []byte{
0x52, 0x0a, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x26, 0x0a, 0x0e,
0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a,
0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x46, 0x75, 0x6e, 0x63,
0x74, 0x69, 0x6f, 0x6e, 0x22, 0xd2, 0x04, 0x0a, 0x0d, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72,
0x74, 0x69, 0x6f, 0x6e, 0x22, 0xfc, 0x04, 0x0a, 0x0d, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72,
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x37, 0x0a, 0x0c,
0x73, 0x79, 0x6e, 0x63, 0x54, 0x78, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01,
......@@ -707,37 +714,40 @@ var file_config_proto_rawDesc = []byte{
0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12,
0x28, 0x0a, 0x0f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0x34, 0x43, 0x68, 0x61, 0x69, 0x6e,
0x33, 0x33, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49,
0x44, 0x34, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x33, 0x33, 0x22, 0xa7, 0x02, 0x0a, 0x13, 0x53, 0x79,
0x6e, 0x63, 0x54, 0x78, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69,
0x67, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x33, 0x33, 0x68, 0x6f, 0x73, 0x74,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x33, 0x33, 0x68,
0x6f, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x75, 0x73, 0x68, 0x48, 0x6f, 0x73, 0x74, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x75, 0x73, 0x68, 0x48, 0x6f, 0x73, 0x74, 0x12,
0x1a, 0x0a, 0x08, 0x70, 0x75, 0x73, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x52, 0x08, 0x70, 0x75, 0x73, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70,
0x75, 0x73, 0x68, 0x42, 0x69, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70,
0x75, 0x73, 0x68, 0x42, 0x69, 0x6e, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x73, 0x74, 0x61, 0x72, 0x74,
0x53, 0x79, 0x6e, 0x63, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03,
0x52, 0x0f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x48, 0x65, 0x69, 0x67, 0x68,
0x74, 0x12, 0x2c, 0x0a, 0x11, 0x73, 0x74, 0x61, 0x72, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x65,
0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x73, 0x74,
0x61, 0x72, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12,
0x24, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x72, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x48, 0x61, 0x73, 0x68,
0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x72, 0x74, 0x53, 0x79, 0x6e,
0x63, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63,
0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61,
0x63, 0x74, 0x73, 0x22, 0xa4, 0x01, 0x0a, 0x06, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x12, 0x22,
0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64,
0x64, 0x72, 0x12, 0x2e, 0x0a, 0x12, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x72, 0x50, 0x72,
0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12,
0x44, 0x34, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x33, 0x33, 0x12, 0x28, 0x0a, 0x0f, 0x70, 0x72, 0x6f,
0x63, 0x65, 0x73, 0x73, 0x57, 0x69, 0x74, 0x68, 0x44, 0x72, 0x61, 0x77, 0x18, 0x0f, 0x20, 0x01,
0x28, 0x08, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x57, 0x69, 0x74, 0x68, 0x44,
0x72, 0x61, 0x77, 0x22, 0xa7, 0x02, 0x0a, 0x13, 0x53, 0x79, 0x6e, 0x63, 0x54, 0x78, 0x52, 0x65,
0x63, 0x65, 0x69, 0x70, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x20, 0x0a, 0x0b, 0x63,
0x68, 0x61, 0x69, 0x6e, 0x33, 0x33, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x0b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x33, 0x33, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x1a, 0x0a,
0x08, 0x70, 0x75, 0x73, 0x68, 0x48, 0x6f, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x08, 0x70, 0x75, 0x73, 0x68, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x75, 0x73,
0x68, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x75, 0x73,
0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x75, 0x73, 0x68, 0x42, 0x69, 0x6e,
0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x75, 0x73, 0x68, 0x42, 0x69, 0x6e,
0x64, 0x12, 0x28, 0x0a, 0x0f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x48, 0x65,
0x69, 0x67, 0x68, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x73, 0x74, 0x61, 0x72,
0x74, 0x53, 0x79, 0x6e, 0x63, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x2c, 0x0a, 0x11, 0x73,
0x74, 0x61, 0x72, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65,
0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x73, 0x74, 0x61, 0x72, 0x74, 0x53, 0x79, 0x6e,
0x63, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x73, 0x74, 0x61,
0x72, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x48, 0x61, 0x73, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09,
0x52, 0x0d, 0x73, 0x74, 0x61, 0x72, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x48, 0x61, 0x73, 0x68, 0x12,
0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03,
0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x22, 0xa4, 0x01,
0x0a, 0x06, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x72,
0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c,
0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x2e, 0x0a, 0x12,
0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x72, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b,
0x65, 0x79, 0x12, 0x26, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73,
0x41, 0x64, 0x64, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69,
0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x41, 0x64, 0x64, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x6e,
0x69, 0x74, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x03, 0x52, 0x0a,
0x69, 0x6e, 0x69, 0x74, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x73, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2e,
0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79,
0x65, 0x72, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x26, 0x0a, 0x0e,
0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x41, 0x64, 0x64, 0x72, 0x18, 0x03,
0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73,
0x41, 0x64, 0x64, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x50, 0x6f, 0x77, 0x65,
0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x03, 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x50, 0x6f,
0x77, 0x65, 0x72, 0x73, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2e, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
......
......@@ -7,12 +7,11 @@
package types
import (
reflect "reflect"
sync "sync"
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
......@@ -2432,6 +2431,108 @@ func (x *ResendChain33EventReq) GetHeight() int64 {
return 0
}
type CfgWithdrawReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
FeeAmount int64 `protobuf:"varint,2,opt,name=feeAmount,proto3" json:"feeAmount,omitempty"`
}
func (x *CfgWithdrawReq) Reset() {
*x = CfgWithdrawReq{}
if protoimpl.UnsafeEnabled {
mi := &file_relayer_proto_msgTypes[36]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CfgWithdrawReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CfgWithdrawReq) ProtoMessage() {}
func (x *CfgWithdrawReq) ProtoReflect() protoreflect.Message {
mi := &file_relayer_proto_msgTypes[36]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CfgWithdrawReq.ProtoReflect.Descriptor instead.
func (*CfgWithdrawReq) Descriptor() ([]byte, []int) {
return file_relayer_proto_rawDescGZIP(), []int{36}
}
func (x *CfgWithdrawReq) GetSymbol() string {
if x != nil {
return x.Symbol
}
return ""
}
func (x *CfgWithdrawReq) GetFeeAmount() int64 {
if x != nil {
return x.FeeAmount
}
return 0
}
type WithdrawSymbol2Fee struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Symbol2Fee map[string]int64 `protobuf:"bytes,1,rep,name=symbol2Fee,proto3" json:"symbol2Fee,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
}
func (x *WithdrawSymbol2Fee) Reset() {
*x = WithdrawSymbol2Fee{}
if protoimpl.UnsafeEnabled {
mi := &file_relayer_proto_msgTypes[37]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *WithdrawSymbol2Fee) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*WithdrawSymbol2Fee) ProtoMessage() {}
func (x *WithdrawSymbol2Fee) ProtoReflect() protoreflect.Message {
mi := &file_relayer_proto_msgTypes[37]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use WithdrawSymbol2Fee.ProtoReflect.Descriptor instead.
func (*WithdrawSymbol2Fee) Descriptor() ([]byte, []int) {
return file_relayer_proto_rawDescGZIP(), []int{37}
}
func (x *WithdrawSymbol2Fee) GetSymbol2Fee() map[string]int64 {
if x != nil {
return x.Symbol2Fee
}
return nil
}
var File_relayer_proto protoreflect.FileDescriptor
var file_relayer_proto_rawDesc = []byte{
......@@ -2709,8 +2810,22 @@ var file_relayer_proto_rawDesc = []byte{
0x72, 0x22, 0x2f, 0x0a, 0x15, 0x52, 0x65, 0x73, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e,
0x33, 0x33, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65,
0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67,
0x68, 0x74, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2e, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x68, 0x74, 0x22, 0x46, 0x0a, 0x0e, 0x43, 0x66, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61,
0x77, 0x52, 0x65, 0x71, 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, 0x1c, 0x0a, 0x09,
0x66, 0x65, 0x65, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52,
0x09, 0x66, 0x65, 0x65, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x9e, 0x01, 0x0a, 0x12, 0x57,
0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x32, 0x46, 0x65,
0x65, 0x12, 0x49, 0x0a, 0x0a, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x32, 0x46, 0x65, 0x65, 0x18,
0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x57, 0x69,
0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x32, 0x46, 0x65, 0x65,
0x2e, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x32, 0x46, 0x65, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79,
0x52, 0x0a, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x32, 0x46, 0x65, 0x65, 0x1a, 0x3d, 0x0a, 0x0f,
0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x32, 0x46, 0x65, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12,
0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65,
0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0a, 0x5a, 0x08, 0x2e,
0x2e, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
......@@ -2725,7 +2840,7 @@ func file_relayer_proto_rawDescGZIP() []byte {
return file_relayer_proto_rawDescData
}
var file_relayer_proto_msgTypes = make([]protoimpl.MessageInfo, 36)
var file_relayer_proto_msgTypes = make([]protoimpl.MessageInfo, 39)
var file_relayer_proto_goTypes = []interface{}{
(*Account4Relayer)(nil), // 0: types.Account4Relayer
(*ValidatorAddr4EthRelayer)(nil), // 1: types.ValidatorAddr4EthRelayer
......@@ -2763,16 +2878,20 @@ var file_relayer_proto_goTypes = []interface{}{
(*ETHConfigLockedTokenOffline)(nil), // 33: types.ETHConfigLockedTokenOffline
(*BalanceLockedReq)(nil), // 34: types.BalanceLockedReq
(*ResendChain33EventReq)(nil), // 35: types.ResendChain33EventReq
(*CfgWithdrawReq)(nil), // 36: types.CfgWithdrawReq
(*WithdrawSymbol2Fee)(nil), // 37: types.WithdrawSymbol2Fee
nil, // 38: types.WithdrawSymbol2Fee.Symbol2FeeEntry
}
var file_relayer_proto_depIdxs = []int32{
25, // 0: types.TokenAddressArray.tokenAddress:type_name -> types.TokenAddress
24, // 1: types.TokenStaticsResponse.e2Cstatics:type_name -> types.Ethereum2Chain33Statics
23, // 2: types.TokenStaticsResponse.c2Estatics:type_name -> types.Chain33ToEthereumStatics
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
38, // 3: types.WithdrawSymbol2Fee.symbol2Fee:type_name -> types.WithdrawSymbol2Fee.Symbol2FeeEntry
4, // [4:4] is the sub-list for method output_type
4, // [4:4] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
}
func init() { file_relayer_proto_init() }
......@@ -3213,6 +3332,30 @@ func file_relayer_proto_init() {
return nil
}
}
file_relayer_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CfgWithdrawReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_relayer_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*WithdrawSymbol2Fee); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
......@@ -3220,7 +3363,7 @@ func file_relayer_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_relayer_proto_rawDesc,
NumEnums: 0,
NumMessages: 36,
NumMessages: 39,
NumExtensions: 0,
NumServices: 0,
},
......
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