Skip to content

Commit

Permalink
Update with new version of data.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielKrawisz committed Mar 30, 2023
1 parent 27e294c commit 7c62148
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions include/gigamonkey/number.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ namespace Gigamonkey {
inline uint<X>::operator string () const {
bytes r (X);
std::copy (begin (), end (), r.rbegin ());
return string {"0x"} + data::encoding::hex::write (r, data::encoding::hex::lower);
return string {"0x"} + encoding::hex::write (r, hex_case::lower);
}

template <size_t X>
Expand All @@ -356,12 +356,12 @@ namespace data::encoding::hexidecimal {

template <size_t size>
std::string inline write (const Gigamonkey::uint<size>& n) {
return write<hex::lower> ((data::N) (n));
return write<hex_case::lower> ((data::N) (n));
}

template <size_t size>
std::ostream inline &write (std::ostream& o, const Gigamonkey::uint<size>& n) {
return o << write<hex::lower> (data::N (n));
return o << write<hex_case::lower> (data::N (n));
}

}
Expand Down Expand Up @@ -411,7 +411,7 @@ namespace Gigamonkey {

template <size_t X>
uint<X>::uint(const N& n) : uint(0) {
ptr<bytes> b = encoding::hex::read (encoding::hexidecimal::write<encoding::hex::lower> (n).substr (2));
ptr<bytes> b = encoding::hex::read (encoding::hexidecimal::write<hex_case::lower> (n).substr (2));
std::reverse(b->begin (), b->end ());
if (b->size () > X) std::copy(b->begin (), b->begin () + X, begin ());
else std::copy(b->begin (), b->end(), begin ());
Expand Down
2 changes: 1 addition & 1 deletion include/gigamonkey/stratum/extensions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ namespace Gigamonkey::Stratum::extensions {
};

inline encoding::hex::fixed<4> write_version_mask(const version_mask& x) {
return encoding::hex::write(x, encoding::hex::lower);
return encoding::hex::write(x, hex_case::lower);
}

inline accepted::accepted() : std::variant<bool, string, std::monostate>{std::monostate{}} {}
Expand Down
2 changes: 1 addition & 1 deletion include/gigamonkey/stratum/session_id.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace Gigamonkey::Stratum {
}

inline session_id::operator encoding::hex::fixed<4>() const {
return encoding::hex::write(*this, encoding::hex::lower);
return encoding::hex::write(*this, hex_case::lower);
}

}
Expand Down
4 changes: 2 additions & 2 deletions src/gigamonkey/script/typed_data_bip_276.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ namespace Gigamonkey {

bytes data = bytes::write (b.size() + 2, version, byte(n), b);

ss << ':' << encoding::hex::write (data, encoding::hex::lower);
ss << ':' << encoding::hex::write (data, hex_case::lower);

auto checksum = Bitcoin::checksum (bytes::from_string(ss.str()));

ss << encoding::hex::write (checksum, encoding::hex::lower);
ss << encoding::hex::write (checksum, hex_case::lower);

return ss.str ();
}
Expand Down
14 changes: 7 additions & 7 deletions src/gigamonkey/stratum/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace Gigamonkey::Stratum::mining {
encoding::hex::fixed<32> inline write(const uint256& x) {
uint256 z = x;
for (int i = 0; i < 32; i+=4) std::reverse(z.begin() + i, z.begin() + i + 3);
return encoding::hex::write(z, encoding::hex::lower);
return encoding::hex::write(z, hex_case::lower);
}

bool read(const JSON& j, uint256& x) {
Expand All @@ -30,7 +30,7 @@ namespace Gigamonkey::Stratum::mining {
}

encoding::hex::string inline write(const bytes& b) {
return encoding::hex::write(b, encoding::hex::lower);
return encoding::hex::write(b, hex_case::lower);
}

bool read(const JSON& j, bytes& x) {
Expand Down Expand Up @@ -65,7 +65,7 @@ namespace Gigamonkey::Stratum::mining {
}

encoding::hex::fixed<4> inline write(const int32_little& x) {
return encoding::hex::write(x, encoding::hex::lower);
return encoding::hex::write(x, hex_case::lower);
}

bool read(const JSON& j, int32_little& x) {
Expand All @@ -81,7 +81,7 @@ namespace Gigamonkey::Stratum::mining {
}

encoding::hex::fixed<4> inline write(const work::compact& x) {
return encoding::hex::write(uint32_big{static_cast<uint32_little>(x)}, encoding::hex::lower);
return encoding::hex::write(uint32_big{static_cast<uint32_little>(x)}, hex_case::lower);
}

bool read(const JSON& j, work::compact& x) {
Expand All @@ -97,7 +97,7 @@ namespace Gigamonkey::Stratum::mining {
}

encoding::hex::fixed<4> inline write(const Bitcoin::timestamp& x) {
return encoding::hex::write(uint32_big{x.Value}, encoding::hex::lower);
return encoding::hex::write(uint32_big{x.Value}, hex_case::lower);
}

bool read(const JSON& j, Bitcoin::timestamp& x) {
Expand All @@ -113,7 +113,7 @@ namespace Gigamonkey::Stratum::mining {
}

encoding::hex::fixed<8> inline write(const uint64_big& x) {
return encoding::hex::write(x, encoding::hex::lower);
return encoding::hex::write(x, hex_case::lower);
}

bool inline read(const JSON& j, uint64_big& x) {
Expand All @@ -126,7 +126,7 @@ namespace Gigamonkey::Stratum::mining {
}

encoding::hex::fixed<4> inline write(const nonce& x) {
return encoding::hex::write(uint32_big{x}, encoding::hex::lower);
return encoding::hex::write(uint32_big{x}, hex_case::lower);
}

bool read(const JSON& j, nonce& x) {
Expand Down

0 comments on commit 7c62148

Please sign in to comment.