Commit 6fd5ed47 authored by duanjinfei's avatar duanjinfei

change test plan and log output

parent 3a3bd5dc
This diff is collapsed.
This diff is collapsed.
...@@ -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("0xb11ba93a30352b831909db093b253fa51e152cb9") contractAddress := common.HexToAddress("0xfb1bF24c0C7e7C1B89c4A496aACf01aBF26C0B94")
//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("0x0358adba05683b259434198ed760b4b9341f8ab041a8980d8d4a0182c4b6021e")) receipt, err := client.TransactionReceipt(context.Background(), common.HexToHash("0x9699843dbe3a809a928ad7a68c009c7c2316bce09566ea9a579fae33e899c95b"))
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) {
......
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