Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
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
plugin
Commits
7e705ce3
Commit
7e705ce3
authored
Nov 24, 2021
by
vipwzw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto ci
parent
ddbe3a60
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
24 additions
and
37 deletions
+24
-37
dockerRelayerTestEvm.sh
plugin/dapp/bridgevmxgo/cmd/build/dockerRelayerTestEvm.sh
+11
-11
evmcontract.pb.go
plugin/dapp/evm/types/evmcontract.pb.go
+4
-8
test-rpc.sh
plugin/dapp/evmxgo/cmd/test/test-rpc.sh
+0
-3
commands.go
plugin/dapp/evmxgo/commands/commands.go
+2
-4
exec_local.go
plugin/dapp/evmxgo/executor/exec_local.go
+1
-0
exec_test.go
plugin/dapp/evmxgo/executor/exec_test.go
+0
-0
rpc.go
plugin/dapp/evmxgo/rpc/rpc.go
+0
-1
const.go
plugin/dapp/evmxgo/types/const.go
+0
-1
evmxgo.go
plugin/dapp/evmxgo/types/evmxgo.go
+2
-1
evmxgo.pb.go
plugin/dapp/evmxgo/types/evmxgo.pb.go
+4
-8
No files found.
plugin/dapp/bridgevmxgo/cmd/build/dockerRelayerTestEvm.sh
View file @
7e705ce3
...
...
@@ -821,25 +821,25 @@ function configbridgevmxgoAddr() {
function
TestETH2EVMToChain33
()
{
# 查询 ETH 这端 bridgeBank 地址原来是 0
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
)
# cli_ret "${result}" "balance" ".balance" "16"
# cli_ret "${result}" "balance" ".balance" "16"
# ETH 这端 lock 11个
result
=
$(${
CLIA
}
ethereum lock
-m
11
-k
"
${
ethTestAddrKey1
}
"
-r
"
${
chain33ReceiverAddr
}
"
)
# cli_ret "${result}" "lock"
# cli_ret "${result}" "lock"
# eth 等待 2 个区块
sleep
4
# 查询 ETH 这端 bridgeBank 地址 11 原来16
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
)
# cli_ret "${result}" "balance" ".balance" "27"
# cli_ret "${result}" "balance" ".balance" "27"
sleep
${
maturityDegree
}
# chain33 chain33EthBridgeTokenAddr(ETH合约中)查询 lock 金额
result
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33EthBridgeTokenAddr
}
"
-c
"
${
chain33DeployAddr
}
"
-b
"balanceOf(
${
chain33ReceiverAddr
}
)"
)
# 结果是 11 * le8
# is_equal "${result}" "4700000000"
# is_equal "${result}" "4700000000"
updateConfig
"ETH"
"
${
chain33EthBridgeTokenAddr
}
"
configbridgevmxgoAddr
"
${
XgoChain33BridgeBank
}
"
...
...
@@ -851,16 +851,16 @@ function TestETH2EVMToChain33() {
check_tx
"
${
Chain33Cli
}
"
"
${
hash
}
"
result
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33EthBridgeTokenAddr
}
"
-c
"
${
chain33DeployAddr
}
"
-b
"balanceOf(
${
chain33ReceiverAddr
}
)"
)
# is_equal "${result}" "4200000000"
# is_equal "${result}" "4200000000"
result
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33EthBridgeTokenAddr
}
"
-c
"
${
chain33DeployAddr
}
"
-b
"balanceOf(
${
XgoChain33BridgeBank
}
)"
)
# is_equal "${result}" "500000000"
# is_equal "${result}" "500000000"
}
function
Testethereum2EVMToChain33_byc
()
{
# 查询 ETH 这端 bridgeBank 地址原来是
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumBycERC20TokenAddr
}
"
)
# cli_ret "${result}" "balance" ".balance" "0"
# cli_ret "${result}" "balance" ".balance" "0"
# ETH 这端 lock 7个
result
=
$(${
CLIA
}
ethereum lock
-m
7
-k
"
${
ethTestAddrKey1
}
"
-r
"
${
chain33ReceiverAddr
}
"
-t
"
${
ethereumBycERC20TokenAddr
}
"
)
...
...
@@ -871,14 +871,14 @@ function Testethereum2EVMToChain33_byc() {
# 查询 ETH 这端 bridgeBank 地址 7
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumBycERC20TokenAddr
}
"
)
# cli_ret "${result}" "balance" ".balance" "7"
# cli_ret "${result}" "balance" ".balance" "7"
sleep
${
maturityDegree
}
# chain33 chain33EthBridgeTokenAddr(ETH合约中)查询 lock 金额
result
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33BycBridgeTokenAddr
}
"
-c
"
${
chain33TestAddr1
}
"
-b
"balanceOf(
${
chain33ReceiverAddr
}
)"
)
# 结果是 7 * le8
# is_equal "${result}" "700000000"
# is_equal "${result}" "700000000"
updateConfig
"BYC"
"
${
chain33BycBridgeTokenAddr
}
"
configbridgevmxgoAddr
"
${
XgoChain33BridgeBank
}
"
...
...
@@ -890,10 +890,10 @@ function Testethereum2EVMToChain33_byc() {
check_tx
"
${
Chain33Cli
}
"
"
${
hash
}
"
result
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33BycBridgeTokenAddr
}
"
-c
"
${
chain33DeployAddr
}
"
-b
"balanceOf(
${
chain33ReceiverAddr
}
)"
)
# is_equal "${result}" "4200000000"
# is_equal "${result}" "4200000000"
result
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33BycBridgeTokenAddr
}
"
-c
"
${
chain33DeployAddr
}
"
-b
"balanceOf(
${
XgoChain33BridgeBank
}
)"
)
# is_equal "${result}" "500000000"
# is_equal "${result}" "500000000"
}
function
AllRelayerMainTest
()
{
...
...
plugin/dapp/evm/types/evmcontract.pb.go
View file @
7e705ce3
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.2
3
.0
// protoc-gen-go v1.2
6
.0
// protoc v3.9.1
// source: evmcontract.proto
package
types
import
(
proto
"github.com/golang/protobuf/proto"
protoreflect
"google.golang.org/protobuf/reflect/protoreflect"
protoimpl
"google.golang.org/protobuf/runtime/protoimpl"
reflect
"reflect"
sync
"sync"
protoreflect
"google.golang.org/protobuf/reflect/protoreflect"
protoimpl
"google.golang.org/protobuf/runtime/protoimpl"
)
const
(
...
...
@@ -21,10 +21,6 @@ const (
_
=
protoimpl
.
EnforceVersion
(
protoimpl
.
MaxVersion
-
20
)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const
_
=
proto
.
ProtoPackageIsVersion4
//合约对象信息
type
EVMContractObject
struct
{
state
protoimpl
.
MessageState
...
...
plugin/dapp/evmxgo/cmd/test/test-rpc.sh
View file @
7e705ce3
...
...
@@ -18,7 +18,6 @@ function updateConfig() {
signRawTxAndQuery
"
$FUNCNAME
"
"
$privateKey
"
"
${
unsignedTx
}
"
}
function
evmxgo_mint
()
{
local
data
=
'{"jsonrpc":"2.0","id":1,"method":"Chain33.CreateTransaction","params":[{"execer":"evmxgo","actionName":"Mint","payload":{"symbol":"DOG","amount":10000000}}]}'
unsignedTx
=
$(
curl
-s
--data-binary
"
$data
"
-H
'content-type:text/plain;'
${
MAIN_HTTP
}
| jq
-r
".result"
)
...
...
@@ -75,8 +74,6 @@ function evmxgo_withdraw() {
signRawTxAndQuery
"
$FUNCNAME
"
"
$privateKey
"
"
${
unsignedTx
}
"
}
# 查询交易的执行结果
# 根据传入的规则,校验查询的结果 (参数1: 校验规则 参数2: 预期匹配结果)
function
queryTransaction
()
{
...
...
plugin/dapp/evmxgo/commands/commands.go
View file @
7e705ce3
...
...
@@ -4,6 +4,8 @@ package commands
import
(
"encoding/json"
"fmt"
"os"
"github.com/33cn/chain33/rpc/jsonclient"
rpctypes
"github.com/33cn/chain33/rpc/types"
"github.com/33cn/chain33/system/dapp/commands"
...
...
@@ -12,7 +14,6 @@ import (
evmxgotypes
"github.com/33cn/plugin/plugin/dapp/evmxgo/types"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"os"
)
/*
...
...
@@ -46,7 +47,6 @@ func Cmd() *cobra.Command {
return
cmd
}
// CreateTokenTransferCmd create raw transfer tx
func
CreateTokenTransferCmd
()
*
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
...
...
@@ -128,7 +128,6 @@ func createTokenWithdraw(cmd *cobra.Command, args []string) {
commands
.
CreateAssetWithdraw
(
cmd
,
args
,
evmxgotypes
.
EvmxgoX
)
}
// GetTokensCreatedCmd get finish created tokens
func
GetTokensCreatedCmd
()
*
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
...
...
@@ -249,7 +248,6 @@ func parseTokenAssetsRes(arg ...interface{}) (interface{}, error) {
return
result
,
nil
}
// CreateRawTokenMintTxCmd create raw token mintage transaction
func
CreateRawTokenMintTxCmd
()
*
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
...
...
plugin/dapp/evmxgo/executor/exec_local.go
View file @
7e705ce3
...
...
@@ -2,6 +2,7 @@ package executor
import
(
"encoding/hex"
"github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types"
...
...
plugin/dapp/evmxgo/executor/exec_test.go
View file @
7e705ce3
This diff is collapsed.
Click to expand it.
plugin/dapp/evmxgo/rpc/rpc.go
View file @
7e705ce3
...
...
@@ -5,4 +5,3 @@ package rpc
* json rpc用Jrpc结构作为接收实例
* grpc使用channelClient结构作为接收实例
*/
plugin/dapp/evmxgo/types/const.go
View file @
7e705ce3
...
...
@@ -19,7 +19,6 @@ const (
EvmxgoActionBurn
=
13
)
const
(
// TyLogEvmxgoTransfer log for token tranfer
TyLogEvmxgoTransfer
=
313
...
...
plugin/dapp/evmxgo/types/evmxgo.go
View file @
7e705ce3
package
types
import
(
"reflect"
log
"github.com/33cn/chain33/common/log/log15"
"github.com/33cn/chain33/types"
"reflect"
)
/*
...
...
plugin/dapp/evmxgo/types/evmxgo.pb.go
View file @
7e705ce3
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.2
3
.0
// protoc-gen-go v1.2
6
.0
// protoc v3.9.1
// source: evmxgo.proto
...
...
@@ -8,13 +8,13 @@ package types
import
(
context
"context"
reflect
"reflect"
sync
"sync"
types
"github.com/33cn/chain33/types"
proto
"github.com/golang/protobuf/proto"
grpc
"google.golang.org/grpc"
protoreflect
"google.golang.org/protobuf/reflect/protoreflect"
protoimpl
"google.golang.org/protobuf/runtime/protoimpl"
reflect
"reflect"
sync
"sync"
)
const
(
...
...
@@ -24,10 +24,6 @@ const (
_
=
protoimpl
.
EnforceVersion
(
protoimpl
.
MaxVersion
-
20
)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const
_
=
proto
.
ProtoPackageIsVersion4
// action
type
EvmxgoAction
struct
{
state
protoimpl
.
MessageState
...
...
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