Coverage Summary for Class: HDWalletUtils (co.rsk.pcc.bto)
Class |
Class, %
|
Method, %
|
Line, %
|
HDWalletUtils |
0%
(0/1)
|
0%
(0/3)
|
0%
(0/9)
|
1 /*
2 * This file is part of RskJ
3 * Copyright (C) 2019 RSK Labs Ltd.
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 package co.rsk.pcc.bto;
20
21 import co.rsk.core.RskAddress;
22 import co.rsk.pcc.NativeContract;
23 import co.rsk.pcc.NativeMethod;
24 import org.ethereum.config.blockchain.upgrades.ActivationConfig;
25
26 import java.util.Arrays;
27 import java.util.List;
28 import java.util.Optional;
29
30 /**
31 * Precompiled contract that provides certain BTO (Bitcoin Token Offering)
32 * related utility functions.
33 *
34 * @author Ariel Mendelzon
35 */
36 public class HDWalletUtils extends NativeContract {
37 private final HDWalletUtilsHelper helper;
38
39 public HDWalletUtils(ActivationConfig config, RskAddress contractAddress) {
40 super(config, contractAddress);
41 this.helper = new HDWalletUtilsHelper();
42 }
43
44 @Override
45 public List<NativeMethod> getMethods() {
46 return Arrays.asList(
47 new ToBase58Check(getExecutionEnvironment()),
48 new DeriveExtendedPublicKey(getExecutionEnvironment(), helper),
49 new ExtractPublicKeyFromExtendedPublicKey(getExecutionEnvironment(), helper),
50 new GetMultisigScriptHash(getExecutionEnvironment())
51 );
52 }
53
54 @Override
55 public Optional<NativeMethod> getDefaultMethod() {
56 return Optional.empty();
57 }
58 }