Skip to content

Commit

Permalink
support heco
Browse files Browse the repository at this point in the history
  • Loading branch information
heropan committed May 25, 2021
1 parent 2096eb9 commit f8be00f
Show file tree
Hide file tree
Showing 13 changed files with 503 additions and 310 deletions.
40 changes: 0 additions & 40 deletions Interface/IEthIDChainSubWallet.h

This file was deleted.

41 changes: 0 additions & 41 deletions SDK/Implement/EthIDChainSubWallet.cpp

This file was deleted.

49 changes: 0 additions & 49 deletions SDK/Implement/EthIDChainSubWallet.h

This file was deleted.

12 changes: 12 additions & 0 deletions SDK/Implement/EthSidechainSubWallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,18 @@ const std::string CALLBACK_IS_NULL_PROMPT = "callback is null";
} else {
net = NULL;
}
} else if (info->GetChainID() == CHAINID_ETHHECO) {
if (netType == "MainNet") {
net = ethereumHecoMainnet;
} else if (netType == "TestNet") {
net = ethereumHecoTestnet;
} else if (netType == "RegTest") {
net = ethereumHecoRinkeby;
} else if (netType == "PrvNet") {
net = ethereumHecoPrvnet;
} else {
net = NULL;
}
} else {
if (netType == "MainNet") {
net = ethereumMainnet;
Expand Down
5 changes: 1 addition & 4 deletions SDK/Implement/MasterWallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
*/
#include "IDChainSubWallet.h"
#include "EthSidechainSubWallet.h"
#include "EthIDChainSubWallet.h"
#include "MainchainSubWallet.h"
#include "SubWallet.h"
#include "MasterWallet.h"
Expand Down Expand Up @@ -474,10 +473,8 @@ namespace Elastos {
return new IDChainSubWallet(info, config, parent, netType);
} else if (info->GetChainID() == "TokenChain") {
return new TokenchainSubWallet(info, config, parent, netType);
} else if (info->GetChainID() == "ETHSC") {
} else if (info->GetChainID() == "ETHSC" || info->GetChainID() == "ETHDID" || info->GetChainID() == "ETHHECO") {
return new EthSidechainSubWallet(info, config, parent, netType);
} else if (info->GetChainID() == "ETHDID") {
return new EthIDChainSubWallet(info, config, parent, netType);
} else {
ErrorChecker::ThrowLogicException(Error::InvalidChainID, "Invalid chain ID: " + info->GetChainID());
}
Expand Down
3 changes: 2 additions & 1 deletion SDK/Plugin/Registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ namespace Elastos {
#define CHAINID_TOKENCHAIN "TokenChain"
#define CHAINID_ESC "ETHSC"
#define CHAINID_ETHDID "ETHDID"
#define CHAINID_ETHHECO "ETHHECO"

const std::vector<std::string> supportChainIDList = {CHAINID_MAINCHAIN, CHAINID_IDCHAIN, CHAINID_TOKENCHAIN, CHAINID_ESC, CHAINID_ETHDID};
const std::vector<std::string> supportChainIDList = {CHAINID_MAINCHAIN, CHAINID_IDCHAIN, CHAINID_TOKENCHAIN, CHAINID_ESC, CHAINID_ETHDID, CHAINID_ETHHECO};

class Registry : public boost::noncopyable {
public:
Expand Down
19 changes: 19 additions & 0 deletions SDK/SpvService/MainNetConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,25 @@ namespace Elastos {
[0, "6afc2eb01956dfe192dc4cd065efdf6c3c80448776ca367a7246d279e228ff0a", 1, 1]
]
}
},
"ETHHECO": {
"Index": 5,
"MinFee": 0,
"FeePerKB": 0,
"DisconnectionTime": 0,
"ChainParameters": {
"Services": 0,
"MagicNumber": 0,
"StandardPort": 0,
"TargetTimeSpan": 0,
"TargetTimePerBlock": 0,
"DNSSeeds": [
"127.0.0.1"
],
"CheckPoints": [
[0, "5751d1772ebc82d52d19d96157bb3f13ca8417217e3c0913adf15f04eb4cb144", 1, 1]
]
}
}
}
)"_json;
Expand Down
19 changes: 19 additions & 0 deletions SDK/SpvService/PrvNetConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,25 @@ namespace Elastos {
[0, "44e11ae079dff7583e99c3cc623dd09ae2b6929a55650a13ab468aae1a47a62f", 1, 1]
]
}
},
"ETHHECO": {
"Index": 5,
"MinFee": 0,
"FeePerKB": 0,
"DisconnectionTime": 0,
"ChainParameters": {
"Services": 0,
"MagicNumber": 0,
"StandardPort": 0,
"TargetTimeSpan": 0,
"TargetTimePerBlock": 0,
"DNSSeeds": [
"127.0.0.1"
],
"CheckPoints": [
[0, "5751d1772ebc82d52d19d96157bb3f13ca8417217e3c0913adf15f04eb4cb144", 1, 1]
]
}
}
}
)"_json;
Expand Down
19 changes: 19 additions & 0 deletions SDK/SpvService/RegTestConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,25 @@ namespace Elastos {
[0, "6940d4ee80218d11098c99db11e997686e587ec482c7281e015c12f1152e71b5", 1, 1]
]
}
},
"ETHHECO": {
"Index": 5,
"MinFee": 0,
"FeePerKB": 0,
"DisconnectionTime": 0,
"ChainParameters": {
"Services": 0,
"MagicNumber": 0,
"StandardPort": 0,
"TargetTimeSpan": 0,
"TargetTimePerBlock": 0,
"DNSSeeds": [
"127.0.0.1"
],
"CheckPoints": [
[0, "5751d1772ebc82d52d19d96157bb3f13ca8417217e3c0913adf15f04eb4cb144", 1, 1]
]
}
}
}
)"_json;
Expand Down
19 changes: 19 additions & 0 deletions SDK/SpvService/TestNetConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,25 @@ namespace Elastos {
[0, "698e5ec133064dabb7c42eb4b2bdfa21e7b7c2326b0b719d5ab7f452ae8f5ee4", 1, 1]
]
}
},
"ETHHECO": {
"Index": 5,
"MinFee": 0,
"FeePerKB": 0,
"DisconnectionTime": 0,
"ChainParameters": {
"Services": 0,
"MagicNumber": 0,
"StandardPort": 0,
"TargetTimeSpan": 0,
"TargetTimePerBlock": 0,
"DNSSeeds": [
"127.0.0.1"
],
"CheckPoints": [
[0, "5751d1772ebc82d52d19d96157bb3f13ca8417217e3c0913adf15f04eb4cb144", 1, 1]
]
}
}
}
)"_json;
Expand Down
Loading

0 comments on commit f8be00f

Please sign in to comment.