1
// Copyright © 2017-2020 Trust Wallet.
2
//
3
// This file is part of Trust. The full Trust copyright notice, including
4
// terms governing use, modification, and redistribution, is contained in the
5
// file LICENSE at the root of the source code distribution tree.
6

7
#include "Entry.h"
8

9
#include "Address.h"
10
#include "Signer.h"
11

12
using namespace TW::Filecoin;
13
using namespace std;
14

15
// Note: avoid business logic from here, rather just call into classes like Address, Signer, etc.
16

17 1
bool Entry::validateAddress(TWCoinType coin, const string& address, TW::byte, TW::byte,
18
                            const char*) const {
19 1
    return Address::isValid(address);
20
}
21

22 1
string Entry::deriveAddress(TWCoinType coin, const PublicKey& publicKey, TW::byte,
23
                            const char*) const {
24 1
    return Address(publicKey).string();
25
}
26

27 1
void Entry::sign(TWCoinType coin, const TW::Data& dataIn, TW::Data& dataOut) const {
28 1
    signTemplate<Signer, Proto::SigningInput>(dataIn, dataOut);
29
}
30

31 1
string Entry::signJSON(TWCoinType coin, const std::string& json, const Data& key) const {
32 1
    return Signer::signJSON(json, key);
33
}

Read our documentation on viewing source code .

Loading