Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #37 from EOSIO/release/1.1.x
Browse files Browse the repository at this point in the history
Release/1.1.x
  • Loading branch information
larryk85 authored Aug 7, 2018
2 parents 34ea771 + a4d6e95 commit 0d4befe
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project(eosio_wasm_sdk)

set(VERSION_MAJOR 1)
set(VERSION_MINOR 1)
set(VERSION_PATCH 0)
set(VERSION_PATCH 1)

if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
message(WARNING "CMAKE_INSTALL_PREFIX is set to default path of ${CMAKE_INSTALL_PREFIX}, resetting to ${CMAKE_INSTALL_PREFIX}/eosio.wasmsdk")
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# WasmSDK
## Version : 1.1.0
## Version : 1.1.1

WasmSDK is a toolchain for WebAssembly (WASM). In addition to being a general purpose WebAssembly toolchain, [EOSIO](https://github.com/eosio/eos) specific optimizations are available to support building EOSIO smart contracts. This new toolchain is built around [Clang 7](https://github.com/eosio/llvm), which means that the SDK has the most currently available optimizations and analyses from LLVM, but as the WASM target is still considered experimental, some optimizations are not available or incomplete.

Expand Down
11 changes: 7 additions & 4 deletions libraries/eosiolib/asset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ namespace eosio {
* @post The amount of this asset is multiplied by a
*/
asset& operator*=( int64_t a ) {
eosio_assert( a == 0 || (amount * a) / a == amount, "multiplication overflow or underflow" );
amount *= a;
eosio_assert( -max_amount <= amount, "multiplication underflow" );
eosio_assert( amount <= max_amount, "multiplication overflow" );
int128_t tmp = (int128_t)amount * (int128_t)a;
eosio_assert( tmp <= max_amount, "multiplication overflow" );
eosio_assert( tmp >= -max_amount, "multiplication underflow" );
amount = (int64_t)tmp;
return *this;
}

Expand Down Expand Up @@ -218,6 +218,8 @@ namespace eosio {
* @post The amount of this asset is divided by a
*/
asset& operator/=( int64_t a ) {
eosio_assert( a != 0, "divide by zero" );
eosio_assert( !(amount == std::numeric_limits<int64_t>::min() && a == -1), "signed division overflow" );
amount /= a;
return *this;
}
Expand Down Expand Up @@ -246,6 +248,7 @@ namespace eosio {
* @pre Both asset must have the same symbol
*/
friend int64_t operator/( const asset& a, const asset& b ) {
eosio_assert( b.amount != 0, "divide by zero" );
eosio_assert( a.symbol == b.symbol, "comparison of assets with different symbols is not allowed" );
return a.amount / b.amount;
}
Expand Down
16 changes: 8 additions & 8 deletions libraries/eosiolib/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ extern "C" {
* eosio::print("sha256 hash generated from data equals provided hash");
* @endcode
*/
void assert_sha256( char* data, uint32_t length, const checksum256* hash );
void assert_sha256( const char* data, uint32_t length, const checksum256* hash );

/**
* Tests if the sha1 hash generated from data matches the provided checksum.
Expand All @@ -67,7 +67,7 @@ void assert_sha256( char* data, uint32_t length, const checksum256* hash );
* eosio::print("sha1 hash generated from data equals provided hash");
* @endcode
*/
void assert_sha1( char* data, uint32_t length, const checksum160* hash );
void assert_sha1( const char* data, uint32_t length, const checksum160* hash );

/**
* Tests if the sha512 hash generated from data matches the provided checksum.
Expand All @@ -92,7 +92,7 @@ void assert_sha1( char* data, uint32_t length, const checksum160* hash );
* eosio::print("sha512 hash generated from data equals provided hash");
* @endcode
*/
void assert_sha512( char* data, uint32_t length, const checksum512* hash );
void assert_sha512( const char* data, uint32_t length, const checksum512* hash );

/**
* Tests if the ripemod160 hash generated from data matches the provided checksum.
Expand All @@ -116,7 +116,7 @@ void assert_sha512( char* data, uint32_t length, const checksum512* hash );
* eosio::print("ripemod160 hash generated from data equals provided hash");
* @endcode
*/
void assert_ripemd160( char* data, uint32_t length, const checksum160* hash );
void assert_ripemd160( const char* data, uint32_t length, const checksum160* hash );

/**
* Hashes `data` using `sha256` and stores result in memory pointed to by hash.
Expand All @@ -134,7 +134,7 @@ void assert_ripemd160( char* data, uint32_t length, const checksum160* hash );
* eos_assert( calc_hash == hash, "invalid hash" );
* @endcode
*/
void sha256( char* data, uint32_t length, checksum256* hash );
void sha256( const char* data, uint32_t length, checksum256* hash );

/**
* Hashes `data` using `sha1` and stores result in memory pointed to by hash.
Expand All @@ -152,7 +152,7 @@ void sha256( char* data, uint32_t length, checksum256* hash );
* eos_assert( calc_hash == hash, "invalid hash" );
* @endcode
*/
void sha1( char* data, uint32_t length, checksum160* hash );
void sha1( const char* data, uint32_t length, checksum160* hash );

/**
* Hashes `data` using `sha512` and stores result in memory pointed to by hash.
Expand All @@ -170,7 +170,7 @@ void sha1( char* data, uint32_t length, checksum160* hash );
* eos_assert( calc_hash == hash, "invalid hash" );
* @endcode
*/
void sha512( char* data, uint32_t length, checksum512* hash );
void sha512( const char* data, uint32_t length, checksum512* hash );

/**
* Hashes `data` using `ripemod160` and stores result in memory pointed to by hash.
Expand All @@ -188,7 +188,7 @@ void sha512( char* data, uint32_t length, checksum512* hash );
* eos_assert( calc_hash == hash, "invalid hash" );
* @endcode
*/
void ripemd160( char* data, uint32_t length, checksum160* hash );
void ripemd160( const char* data, uint32_t length, checksum160* hash );

/**
* Calculates the public key used for a given signature and hash used to create a message.
Expand Down

0 comments on commit 0d4befe

Please sign in to comment.