(tx *types.Transaction, err error, client *cpclient.Client, contractAddress common.Address)
| 32 | ) |
| 33 | |
| 34 | func printTx(tx *types.Transaction, err error, client *cpclient.Client, contractAddress common.Address) context.Context { |
| 35 | ctx := context.Background() |
| 36 | // fmt.Printf("Transaction: 0x%x\n", tx.Hash()) |
| 37 | // startTime := time.Now() |
| 38 | // fmt.Printf("TX start @:%s", time.Now()) |
| 39 | addressAfterMined, err := bind.WaitDeployed(ctx, client, tx) |
| 40 | if err != nil { |
| 41 | log.Fatalf("failed to deploy contact when mining :%v", err) |
| 42 | } |
| 43 | // fmt.Printf("tx mining take time:%s\n", time.Since(startTime)) |
| 44 | if !bytes.Equal(contractAddress.Bytes(), addressAfterMined.Bytes()) { |
| 45 | log.Fatalf("mined contractAddress :%s,before mined contractAddress:%s", addressAfterMined, contractAddress) |
| 46 | } |
| 47 | return ctx |
| 48 | } |
| 49 | |
| 50 | func printBalance(client *cpclient.Client, fromAddress common.Address) { |
| 51 | // Check balance. |
no test coverage detected