MCPcopy Create free account
hub / github.com/CPChain/chain / printTx

Function printTx

tools/smartcontract/deploy/util.go:34–48  ·  view source on GitHub ↗
(tx *types.Transaction, err error, client *cpclient.Client, contractAddress common.Address)

Source from the content-addressed store, hash-verified

32)
33
34func 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
50func printBalance(client *cpclient.Client, fromAddress common.Address) {
51 // Check balance.

Callers 5

DeployCampaignFunction · 0.85
DeployRNodeFunction · 0.85
DeployRptFunction · 0.85
DeployNetworkFunction · 0.85
DeployAdmissionFunction · 0.85

Calls 2

EqualMethod · 0.65
BytesMethod · 0.65

Tested by

no test coverage detected