diff --git a/include/eosio/opaque.hpp b/include/eosio/opaque.hpp index 82c1c13..a9cf925 100644 --- a/include/eosio/opaque.hpp +++ b/include/eosio/opaque.hpp @@ -67,6 +67,12 @@ class opaque_base { void from(S& stream) { eosio::from_bin(this->bin, stream); } + + template + void to_bin(S& stream) const { + eosio::to_bin(this->bin, stream); + } + }; template @@ -93,6 +99,7 @@ class opaque> : public opaque_base> { this->unpack_next(obj); return obj; } + }; template @@ -105,4 +112,9 @@ void from_bin(opaque& obj, S& stream) { obj.from(stream); } -} // namespace eosio \ No newline at end of file + template + void to_bin(const opaque& obj, S& stream) { + obj.to_bin(stream); + } + +} // namespace eosio