#include "shine_core_content.h" #include #include #include #include #include using namespace shine_core; static Bytes unhex(const std::string& s){Bytes b;for(size_t i=0;i f;std::string x;while(std::getline(ss,x,'\t'))f.push_back(x);assert(f.size()==10);auto core=unhex(f[2]),content=unhex(f[4]),owner=unhex(f[1]),ci=unhex(f[6]),pi=unhex(f[8]);auto u16=[](const uint8_t* p){return uint16_t(p[0]*256+p[1]);};uint16_t type=u16(content.data()+1),sub=u16(content.data()+3),ver=u16(content.data()+5);uint64_t timestamp=0;for(int i=37;i<45;i++)timestamp=(timestamp<<8)|core[i];Bytes body;if(core.size()==149){if(type!=3&&type!=4)putBE(body,type==0?0:getBE(core.data()+109),4);body.insert(body.end(),core.begin()+113,core.begin()+149);putBE(body,17,4);}body.insert(body.end(),content.begin()+7,content.end());Bytes actual,expected;putBE(expected,ci.size(),4);expected.insert(expected.end(),ci.begin(),ci.end());expected.insert(expected.end(),pi.begin(),pi.end());assert(buildPair(type,sub,ver,body,getBE(core.data()+33),timestamp,core.data()+1,owner.data(),seed,"test5595",sha256,sha384,sign,actual));assert(actual==expected);++count;} assert(count>0);std::cout<