Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
EduMenges committed Jul 29, 2024
1 parent 7742702 commit 5a2802e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
3 changes: 1 addition & 2 deletions src/account/EscrowTransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ namespace sgns
uint64_t num_chunks = tx_struct.num_chunks();
float dev_cut = tx_struct.dev_cut();
uint256_t dev_addr( tx_struct.dev_addr() );
return EscrowTransaction( UTXOTxParameters{ inputs, outputs }, num_chunks, dev_addr, dev_cut,
tx_struct.dag_struct() ); // Return new instance
return { UTXOTxParameters{ inputs, outputs }, num_chunks, dev_addr, dev_cut, tx_struct.dag_struct() };
}

uint64_t EscrowTransaction::GetNumChunks() const
Expand Down
8 changes: 4 additions & 4 deletions src/crypto/bip39/mnemonic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ namespace sgns::crypto::bip39 {
mnemonic_list = phrase;
}

if (mnemonic_list.find("/") != std::string_view::npos) {
base::createLogger(kMnemonicLoggerString)
->error("junctions are not supported yet");
return bip39::MnemonicError::INVALID_MNEMONIC;
if ( mnemonic_list.find( '/' ) != std::string_view::npos )
{
base::createLogger( kMnemonicLoggerString )->error( "junctions are not supported yet" );
return bip39::MnemonicError::INVALID_MNEMONIC;
}

// split word list into separate words
Expand Down
25 changes: 12 additions & 13 deletions src/processing/processing_imagesplit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,16 @@ namespace sgns::processing
// SplitImageData();
//}

ImageSplitter::ImageSplitter(const std::vector<uint8_t>& buffer,
uint32_t blockstride,
uint32_t blocklinestride,
uint32_t blocklen)
: blockstride_(blockstride), blocklinestride_(blocklinestride), blocklen_(blocklen) {
// Set inputImage and imageSize from the provided buffer
//inputImage = reinterpret_cast<const unsigned char*>(buffer.data());

inputImage = reinterpret_cast<const unsigned char*>(buffer.data());
imageSize = buffer.size();

ImageSplitter::ImageSplitter( const std::vector<uint8_t> &buffer,
uint32_t blockstride,
uint32_t blocklinestride,
uint32_t blocklen ) :
blockstride_( blockstride ),
blocklinestride_( blocklinestride ),
blocklen_( blocklen ),
inputImage( reinterpret_cast<const unsigned char *>( buffer.data() ) ),
imageSize( buffer.size() )
{
SplitImageData();
}

Expand All @@ -72,7 +71,7 @@ namespace sgns::processing
return index;
}
//Index out of range
return -1;
return -1;
}

void ImageSplitter::SplitImageData()
Expand Down Expand Up @@ -116,7 +115,7 @@ namespace sgns::processing
SHA256_Final(shahash.data(), &sha256);
auto hash = libp2p::multi::Multihash::create(libp2p::multi::HashType::sha256, shahash);
cids_.emplace_back( libp2p::multi::ContentIdentifier::Version::V0,
libp2p::multi::MulticodecType::Code::DAG_PB,
libp2p::multi::MulticodecType::Code::DAG_PB,
hash.value() );
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ namespace sgns::processing
* @param origwidth - Width of image
* @param origheight - Height of image
*/
MNN::Tensor MNNProcess( const std::vector<uint8_t> &imgdata, const int origwidth, const int origheight,
const std::string filename = "" );
MNN::Tensor MNNProcess( const std::vector<uint8_t> &imgdata,
int origwidth,
int origheight,
const std::string &filename = "" );

std::unique_ptr<std::vector<std::vector<char>>> imageData_;
std::unique_ptr<std::vector<uint8_t>> modelFile_;
Expand Down

0 comments on commit 5a2802e

Please sign in to comment.