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

Function PrepareAll

tools/contract-admin/utils/utils.go:162–187  ·  view source on GitHub ↗
(ctx *cli.Context, withTransactor bool)

Source from the content-addressed store, hash-verified

160}
161
162func PrepareAll(ctx *cli.Context, withTransactor bool) (addr common.Address, client *cpclient.Client, key *keystore.Key, err error) {
163
164 endpoint, err := flags.GetEndpoint(ctx)
165 if err != nil {
166 return common.Address{}, nil, nil, err
167 }
168 addr, err = flags.GetContractAddress(ctx)
169 if err != nil {
170 return common.Address{}, nil, nil, err
171 }
172 client, err = PrepareCpclient(endpoint)
173 if err != nil {
174 return common.Address{}, nil, nil, err
175 }
176
177 if withTransactor {
178 keystoreFile, err := flags.GetKeystorePath(ctx)
179 if err != nil {
180 return common.Address{}, &cpclient.Client{}, &keystore.Key{}, err
181 }
182 password := GetPassword()
183 _, key = GetAddressAndKey(keystoreFile, password)
184 }
185
186 return addr, client, key, nil
187}
188
189func WaitMined(client *cpclient.Client, tx *types.Transaction) error {
190

Callers

nothing calls this directly

Calls 3

PrepareCpclientFunction · 0.85
GetPasswordFunction · 0.85
GetAddressAndKeyFunction · 0.85

Tested by

no test coverage detected