Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
contract-case
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
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
duanjinfei
contract-case
Commits
6fd5ed47
Commit
6fd5ed47
authored
May 15, 2023
by
duanjinfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change test plan and log output
parent
3a3bd5dc
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
262 additions
and
137 deletions
+262
-137
noRelatedCase.go
operator/noRelatedCase.go
+151
-43
partlyRelatedCase.go
operator/partlyRelatedCase.go
+107
-89
contract_test.go
test/contract_test.go
+4
-5
No files found.
operator/noRelatedCase.go
View file @
6fd5ed47
This diff is collapsed.
Click to expand it.
operator/partlyRelatedCase.go
View file @
6fd5ed47
This diff is collapsed.
Click to expand it.
test/contract_test.go
View file @
6fd5ed47
...
@@ -14,13 +14,12 @@ import (
...
@@ -14,13 +14,12 @@ import (
func
TestGetContractAbi
(
t
*
testing
.
T
)
{
func
TestGetContractAbi
(
t
*
testing
.
T
)
{
// 连接以太坊网络
// 连接以太坊网络
client
,
err
:=
ethclient
.
Dial
(
"http://
54.72.101.87
:50000"
)
client
,
err
:=
ethclient
.
Dial
(
"http://
192.168.1.118
:50000"
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Fatal
(
err
)
log
.
Fatal
(
err
)
}
}
// 从合约地址获取合约代码
// 从合约地址获取合约代码
contractAddress
:=
common
.
HexToAddress
(
"0x
b11ba93a30352b831909db093b253fa51e152cb9
"
)
contractAddress
:=
common
.
HexToAddress
(
"0x
fb1bF24c0C7e7C1B89c4A496aACf01aBF26C0B94
"
)
//code, err := client.CodeAt(context.Background(), contractAddress, nil)
//code, err := client.CodeAt(context.Background(), contractAddress, nil)
//if err != nil {
//if err != nil {
...
@@ -42,12 +41,12 @@ func TestGetContractAbi(t *testing.T) {
...
@@ -42,12 +41,12 @@ func TestGetContractAbi(t *testing.T) {
}
}
log
.
Info
(
"balance:"
,
balance
.
String
())
log
.
Info
(
"balance:"
,
balance
.
String
())
receipt
,
err
:=
client
.
TransactionReceipt
(
context
.
Background
(),
common
.
HexToHash
(
"0x
0358adba05683b259434198ed760b4b9341f8ab041a8980d8d4a0182c4b6021e
"
))
receipt
,
err
:=
client
.
TransactionReceipt
(
context
.
Background
(),
common
.
HexToHash
(
"0x
9699843dbe3a809a928ad7a68c009c7c2316bce09566ea9a579fae33e899c95b
"
))
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Fatal
(
"Get receipt error:"
,
err
.
Error
())
log
.
Fatal
(
"Get receipt error:"
,
err
.
Error
())
return
return
}
}
log
.
Info
(
"status:"
,
receipt
.
Status
,
",tranNonce:"
,
receipt
.
TransactionIndex
)
log
.
Info
(
"status:"
,
receipt
.
Status
,
",tranNonce:"
,
receipt
.
TransactionIndex
,
",GasUsed:"
,
receipt
.
GasUsed
)
}
}
func
TestGetErc20Balance
(
t
*
testing
.
T
)
{
func
TestGetErc20Balance
(
t
*
testing
.
T
)
{
...
...
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