From c88ce7984e95bc3e99e97ca637ab39b33757c2b0 Mon Sep 17 00:00:00 2001 From: Daniel Larimer Date: Thu, 15 Aug 2013 19:36:54 -0400 Subject: [PATCH] adding more helper methods to time and elliptic crypto --- include/fc/crypto/elliptic.hpp | 3 +++ include/fc/time.hpp | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/fc/crypto/elliptic.hpp b/include/fc/crypto/elliptic.hpp index a3a0736..fc717c5 100644 --- a/include/fc/crypto/elliptic.hpp +++ b/include/fc/crypto/elliptic.hpp @@ -31,6 +31,9 @@ namespace fc { ~public_key(); bool verify( const fc::sha256& digest, const signature& sig ); public_key_data serialize()const; + + operator public_key_data()const { return serialize(); } + public_key( const public_key_data& v ); public_key( const compact_signature& c, const fc::sha256& digest ); diff --git a/include/fc/time.hpp b/include/fc/time.hpp index 85d0568..7b38eaf 100644 --- a/include/fc/time.hpp +++ b/include/fc/time.hpp @@ -74,8 +74,9 @@ namespace fc { utc_seconds = t.time_since_epoch().count() / 1000000ll; return *this; } - friend bool operator < ( const time_point_sec& a, const time_point_sec& b ) { return a.utc_seconds < b.utc_seconds; } - friend bool operator > ( const time_point_sec& a, const time_point_sec& b ) { return a.utc_seconds > b.utc_seconds; } + friend bool operator < ( const time_point_sec& a, const time_point_sec& b ) { return a.utc_seconds < b.utc_seconds; } + friend bool operator > ( const time_point_sec& a, const time_point_sec& b ) { return a.utc_seconds > b.utc_seconds; } + friend bool operator == ( const time_point_sec& a, const time_point_sec& b ) { return a.utc_seconds == b.utc_seconds; } private: uint32_t utc_seconds;