Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
10c69fa
Adjust verbiage and fix typos for issuerestrictedasset and reissueres…
Scotty0448 Dec 5, 2019
67a8901
Display correct unit (RVN,mRVN,μRVN) in Qt wallet transaction history…
sphericale Dec 6, 2019
dd67119
Merging new btc tests and a new RPC call (#701)
spyder46n2 Dec 6, 2019
cc080b4
fixing a few new build warnings
Dec 6, 2019
806feee
Merge branch 'develop' into mney_fix_reward_build_warnings_OSX
spyder46n2 Dec 6, 2019
5401f0e
Fix restricted freeze unfreeze mempool, update rpc call (#704)
blondfrogs Dec 6, 2019
2f1578d
Wrapping change of ByteSize to ByteSizeLong in #if version check.
spyder46n2 Dec 6, 2019
6fc4c49
Merge branch 'develop' into mney_fix_reward_build_warnings_OSX
spyder46n2 Dec 6, 2019
fe7f37b
Fix parameter names and additional typos
Scotty0448 Dec 6, 2019
bdbd2d6
Merge pull request #705 from RavenProject/mney_fix_reward_build_warni…
spyder46n2 Dec 9, 2019
4b6d414
Add additional rpc data to listsinceblock
blondfrogs Dec 9, 2019
83227f7
Merge branch 'develop' into display_units
blondfrogs Dec 9, 2019
8f6105d
fixing broken restricted asset test and loop argument
Dec 9, 2019
dd15be3
Realized I should have left the freeze/unfreeze in with an expected a…
Dec 10, 2019
3742b1a
Merge pull request #703 from standard-error/display_units
spyder46n2 Dec 10, 2019
54ce09d
Merge branch 'develop' into mney_fix_loop_and_restricted_assets_test
spyder46n2 Dec 10, 2019
892281a
Adding another BTC test into RVN
Dec 10, 2019
f36cae2
Merge pull request #708 from RavenProject/mney_fix_loop_and_restricte…
spyder46n2 Dec 10, 2019
6653230
Merge branch 'develop' into mney_add_interface_rpc_test
spyder46n2 Dec 10, 2019
f58e7b1
Merge branch 'develop' into develop
Scotty0448 Dec 11, 2019
d38c43c
Merge pull request #709 from RavenProject/mney_add_interface_rpc_test
spyder46n2 Dec 11, 2019
ec22fa0
Merge branch 'develop' into develop
Scotty0448 Dec 12, 2019
4ed7ac2
Update asm output when decoding a script
blondfrogs Dec 19, 2019
1b4d23d
fixing the script_tests/script_json_test
Dec 20, 2019
61dd950
Merge pull request #714 from blondfrogs/asm_update
spyder46n2 Dec 20, 2019
646b931
added vebosity to the tests
cfrogjump Dec 20, 2019
7fd049a
Merge branch 'develop' into develop
Scotty0448 Dec 21, 2019
4b94438
Fix script size check by gu3
blondfrogs Dec 23, 2019
77fdb75
Update restricted assets checks
blondfrogs Jan 2, 2020
228704e
Merge pull request #716 from RavenProject/action-test-tweak
spyder46n2 Jan 6, 2020
634d767
Merge branch 'develop' into script_size
blondfrogs Jan 6, 2020
af90084
Merge pull request #717 from blondfrogs/script_size
blondfrogs Jan 6, 2020
b958ee9
Merge branch 'develop' into develop
blondfrogs Jan 6, 2020
75aa3c2
Adjust rpc names for issue and reissue of restricted assetes
blondfrogs Jan 6, 2020
f6245b8
Add restricted assets activation vote time
blondfrogs Jan 7, 2020
cb27892
[Consensus] Add restricted assets activation vote time
blondfrogs Jan 8, 2020
0a89173
Fix functional tests before deploy
blondfrogs Jan 8, 2020
b2aa45f
[Tests] Fix functional tests before deploy
blondfrogs Jan 8, 2020
6ab706d
Update version to 3.3
blondfrogs Jan 9, 2020
3371d66
[Version] Update version to 3.3
blondfrogs Jan 9, 2020
6593f8c
branch stuff
cfrogjump Jan 10, 2020
594222e
moving things around
cfrogjump Jan 10, 2020
cff8a44
passing more vars
cfrogjump Jan 10, 2020
532a3e6
Merge pull request #724 from cfrogjump/release_3.3.0.0
spyder46n2 Jan 10, 2020
11320c9
Allow for scanning for message channels to fail
blondfrogs Jan 13, 2020
9a47519
Add Doxygen docs generation
hans-schmidt Jul 27, 2019
1f61f43
Fix for Boost utf8_codecvt_facet warnings on macOS
volbil Aug 29, 2019
b63a0b5
Add vanity address generator to tools
JonPizza Dec 1, 2019
c5f2d31
Add user instructions at top of file
blondfrogs Jan 13, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .github/scripts/05-binary-checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
OS=${1}
GITHUB_WORKSPACE=${2}

export BOOST_TEST_LOG_LEVEL=error

if [[ ${OS} == "windows" ]]; then
echo "----------------------------------------"
echo "Checking binary security for ${OS}"
Expand Down
8 changes: 4 additions & 4 deletions .github/scripts/06-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ OS=${1}
GITHUB_WORKSPACE=${2}
GITHUB_BASE_REF=${3}

echo "----------------------------------------"
env
echo "----------------------------------------"

if [[ ! ${OS} || ! ${GITHUB_WORKSPACE} || ! ${GITHUB_BASE_REF} ]]; then
echo "Error: Invalid options"
echo "Usage: ${0} <operating system> <github workspace path> <github base ref>"
Expand All @@ -28,10 +32,6 @@ if [[ ! -e ${RELEASE_LOCATION} ]]; then
mkdir -p ${RELEASE_LOCATION}
fi

echo "----------------------------------------"
env
echo "----------------------------------------"

echo "----------------------------------------"
echo "GITHUB_BASE_REF: ${GITHUB_BASE_REF}"
echo "----------------------------------------"
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/build-raven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Build Raven

on:
push:
tags:
- v*
branches:
- release*
pull_request:
branches:
- develop
Expand All @@ -15,8 +15,7 @@ on:
- 'whitepaper/**'
- 'binaries/**'
- 'contrib/**'
tags:
- v*

env:
SCRIPTS: ${{ GITHUB.WORKSPACE }}/.github/scripts
AWS_S3_ENABLE: ${{ secrets.AWS_S3_ENABLE }}
Expand Down Expand Up @@ -55,7 +54,7 @@ jobs:
run: ${SCRIPTS}/05-binary-checks.sh ${{ MATRIX.OS }} ${{ GITHUB.WORKSPACE }}

- name: Package Up the Build
run: ${SCRIPTS}/06-package.sh ${{ MATRIX.OS }} ${{ GITHUB.WORKSPACE }} ${{ GITHUB.BASE_REF }}
run: ${SCRIPTS}/06-package.sh ${{ MATRIX.OS }} ${{ GITHUB.WORKSPACE }} ${{ GITHUB.BASE_REF }} ${{ GITHUB.REF }}

- name: Upload Build to the Nightly Site
if: env.AWS_S3_ENABLE == 'true'
Expand Down
17 changes: 16 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,21 @@ CLEANFILES = $(OSX_DMG) $(RAVEN_WIN_INSTALLER)

DISTCHECK_CONFIGURE_FLAGS = --enable-man

clean-local:
doc/doxygen/.stamp: doc/Doxyfile FORCE
$(MKDIR_P) $(@D)
$(DOXYGEN) $^
$(AM_V_at) touch $@

if HAVE_DOXYGEN
docs: doc/doxygen/.stamp
else
docs:
@echo "error: doxygen not found"
endif

clean-docs:
rm -rf doc/doxygen

clean-local: clean-docs
rm -rf coverage_percent.txt test_raven.coverage/ total.coverage/ test/tmp/ cache/ $(OSX_APP)
rm -rf test/functional/__pycache__
89 changes: 89 additions & 0 deletions assets/tools/vanity_address_gen.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
from ravenrpc import Ravencoin # pip install ravenrpc
import sys
import os
import time

# Requires ravenrpc==0.2.4
#
# usage:
# ```
# python vanity_address_gen.py ( rpcuser ) ( rpcpass ) ( prefix ) ( ignore_case=True )
# ```



def valid_base58(s):
for c in ('0', 'O', 'l', '1'):
if c in s:
print(f'Cannot use charachter "{c}" in prefix!!')
exit()

def success_odds(prefix, ignore_case):
odds = 1
for letter in prefix[1:]:
if letter in ('o', 'l') or not ignore_case:
odds *= 58
else:
odds *= 29
return odds

def create_rvn_inst():
try:
rvn = Ravencoin(sys.argv[1], sys.argv[2])
except IndexError:
print('You must provide a valid rpc username and rpc password!')
exit()
return rvn

def get_args():
try:
prefix = sys.argv[3]
except IndexError:
print('Missing options!\n'
'Usage: `python gen.py <rpcuser> <rpcpass> <prefix> <ignore case (default True)>`')
exit()
ignore_case = sys.argv[4] if len(sys.argv) > 4 else True
if prefix[0] != 'R':
print('Please start your prefix with an "R"\n'
'Usage: `python gen.py <rpcuser> <rpcpass> <prefix> <ignore case (default True)>`')
exit()
return prefix, ignore_case, create_rvn_inst()

def validate_rvn(rvn):
if rvn.getinfo() == '':
print('Run ravend')
exit()

def display_stats(count, start, addr, prefix, odds):
addr_sec = count/(time.time() - start)
os.system('cls' if os.name == 'nt' else 'clear')
print(f'Tried {count} addresses\n'
f'Seconds Spent: {time.time() - start}\n'
f'Ave. Addresses/sec: {addr_sec}\n'
f'Lastest Address: {addr}\n'
f'Prefix: {prefix}\n'
f'You have a 1 in {odds} chance per address!\n'
f'At this rate, you will find your address in ~{odds/addr_sec/60} minutes!\n'
'To stop, press Ctrl-C', flush=True, end='')


def main():
prefix, ignore_case, rvn = get_args()
validate_rvn(rvn)
valid_base58(prefix)
start = time.time()
odds = success_odds(prefix, ignore_case)
count = 0
address = rvn.getnewaddress()['result']
try:
while not address.lower().startswith(prefix.lower()) if ignore_case else address.startswith(prefix):
address = rvn.getnewaddress()['result']
count += 1
if count % 100 == 1:
display_stats(count, start, address, prefix, odds)
except KeyboardInterrupt:
exit()
print(f'\nFound an address that starts with {prefix}!\n It is saved to your wallet. Use it freely!\n{address}')

if __name__ == '__main__':
main()
12 changes: 9 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 3)
define(_CLIENT_VERSION_MINOR, 2)
define(_CLIENT_VERSION_REVISION, 1)
define(_CLIENT_VERSION_MINOR, 3)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2019)
Expand Down Expand Up @@ -94,6 +94,12 @@ AC_PATH_TOOL(READELF, readelf)
AC_PATH_TOOL(CPPFILT, c++filt)
AC_PATH_TOOL(OBJCOPY, objcopy)

AC_PATH_PROG(DOXYGEN, doxygen)
if test -z "$DOXYGEN"; then
AC_MSG_WARN([Doxygen not found])
fi
AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])

AC_ARG_VAR(PYTHONPATH, Augments the default search path for python module files)

# Enable wallet
Expand Down Expand Up @@ -1242,7 +1248,7 @@ AC_SUBST(PROTOBUF_LIBS)
AC_SUBST(QR_LIBS)
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist test/config.ini])
AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh])
AC_CONFIG_FILES([doc/Doxyfile])
AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile])])
AC_CONFIG_LINKS([contrib/filter-lcov.py:contrib/filter-lcov.py])
AC_CONFIG_LINKS([test/functional/test_runner.py:test/functional/test_runner.py])
AC_CONFIG_LINKS([test/util/raven-util-test.py:test/util/raven-util-test.py])
Expand Down
4 changes: 2 additions & 2 deletions contrib/linearize/example-linearize.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ max_height=313000
# bootstrap.dat input/output settings (linearize-data)

# mainnet
netmagic=f9beb4d9
genesis=000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
netmagic=43524f57
genesis=0b2c703dc93bb63a36c4e33b85be4855ddbca2ac951a7a0a29b8de0408200a3c
input=/home/example/.raven/blocks

# testnet
Expand Down
31 changes: 9 additions & 22 deletions contrib/linearize/linearize-data.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import re
import os
import os.path
import subprocess
import sys
import hashlib
import datetime
import time
from collections import namedtuple
Expand Down Expand Up @@ -49,23 +49,11 @@ def wordreverse(in_buf):
out_words.reverse()
return b''.join(out_words)

def calc_hdr_hash(blk_hdr):
hash1 = hashlib.sha256()
hash1.update(blk_hdr)
hash1_o = hash1.digest()

hash2 = hashlib.sha256()
hash2.update(hash1_o)
hash2_o = hash2.digest()

return hash2_o

def calc_hash_str(blk_hdr):
hash = calc_hdr_hash(blk_hdr)
hash = bufreverse(hash)
hash = wordreverse(hash)
hash_str = hexlify(hash).decode('utf-8')
return hash_str
x16r_hash_cmd = os.path.dirname(os.path.realpath(__file__)) + "/../../src/test/test_raven_hash"
cmd = [x16r_hash_cmd, hexlify(blk_hdr).decode('utf-8'), "2"]
blk_hash = subprocess.run(cmd, stdout=subprocess.PIPE, check=True).stdout.decode('ascii')
return blk_hash

def get_blk_dt(blk_hdr):
members = struct.unpack("<I", blk_hdr[68:68+4])
Expand Down Expand Up @@ -216,7 +204,7 @@ def run(self):

inMagic = inhdr[:4]
if (inMagic != self.settings['netmagic']):
print("Invalid magic: " + hexlify(inMagic).decode('utf-8'))
print("Invalid magic: " + hexlify(inMagic).decode('utf-8') + " (" + str(inMagic) + ")")
return
inLenLE = inhdr[4:]
su = struct.unpack("<I", inLenLE)
Expand All @@ -228,8 +216,7 @@ def run(self):
if not self.hash_str in blkmap:
# Because blocks can be written to files out-of-order as of 0.10, the script
# may encounter blocks it doesn't know about. Treat as debug output.
if settings['debug_output'] == 'true':
print("Skipping unknown block " + self.hash_str)
print("Skipping unknown block " + self.hash_str)
self.inF.seek(inLen, os.SEEK_CUR)
continue

Expand Down Expand Up @@ -284,9 +271,9 @@ def run(self):
settings['rev_hash_bytes'] = settings['rev_hash_bytes'].lower()

if 'netmagic' not in settings:
settings['netmagic'] = 'f9beb4d9'
settings['netmagic'] = '43524f57'
if 'genesis' not in settings:
settings['genesis'] = '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f'
settings['genesis'] = '0b2c703dc93bb63a36c4e33b85be4855ddbca2ac951a7a0a29b8de0408200a3c'
if 'input' not in settings:
settings['input'] = 'input'
if 'hashlist' not in settings:
Expand Down
Binary file added crash
Binary file not shown.
14 changes: 13 additions & 1 deletion doc/developer-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,21 @@ Not OK (used plenty in the current source, but not picked up):
//
```

A full list of comment syntaxes picked up by doxygen can be found at http://www.stack.nl/~dimitri/doxygen/manual/docblocks.html,
A full list of comment syntaxes picked up by doxygen can be found at
http://www.stack.nl/~dimitri/doxygen/manual/docblocks.html,
but if possible use one of the above styles.

The Ravencoin Doxygen documentation can be generated by running `make docs` from the top-level
directory of the repository.
That creates the documentation in the directory "doc/doxygen" and the it can be accessed by a browser at:
doc/doxygen/html/index.html
The documentation can by deleted by running `make clean-docs`.

Before running `make docs`, you will need to install dependencies `doxygen` and `dot` (a component
of `graphviz`). For example,
on MacOS via Homebrew: `brew install doxygen --with-graphviz`
on Debian/Ubuntu: `sudo install doxygen graphviz`

Development tips and tricks
---------------------------

Expand Down
17 changes: 13 additions & 4 deletions src/assets/assets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ bool IsAssetNameASubQualifier(const std::string& name)

bool IsAssetNameValid(const std::string& name, AssetType& assetType, std::string& error)
{
// Do a max length check first to stop the possibility of a stack exhaustion.
// We check for a value that is larger than the max asset name
if (name.length() > 40)
return false;

assetType = AssetType::INVALID;
if (std::regex_match(name, UNIQUE_INDICATOR))
{
Expand Down Expand Up @@ -900,6 +905,14 @@ bool AssetNullVerifierDataFromScript(const CScript& scriptPubKey, CNullAssetTxVe
//! Call VerifyNewAsset if this function returns true
bool CTransaction::IsNewAsset() const
{
// New Asset transaction will always have at least three outputs.
// 1. Owner Token output
// 2. Issue Asset output
// 3. RVN Burn Fee
if (vout.size() < 3) {
return false;
}

// Check for the assets data CTxOut. This will always be the last output in the transaction
if (!CheckIssueDataTx(vout[vout.size() - 1]))
return false;
Expand Down Expand Up @@ -5292,10 +5305,6 @@ bool CheckNewAsset(const CNewAsset& asset, std::string& strError)
}
}

if (assetType == AssetType::RESTRICTED) {
// TODO add more restricted asset checks
}

if (IsAssetNameAnOwner(std::string(asset.strName))) {
strError = _("Invalid parameters: asset_name can't have a '!' at the end of it. See help for more details.");
return false;
Expand Down
5 changes: 2 additions & 3 deletions src/assets/rewards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ bool BuildTransaction(
const std::vector<OwnerAndAmount> & p_pendingPayments,const int& start,
std::string& change_address, uint256& retTxid)
{
bool fcnRetVal = false;
int expectedCount = 0;
int actualCount = 0;
CValidationState state;
Expand Down Expand Up @@ -285,7 +284,7 @@ bool BuildTransaction(
std::vector<CRecipient> vDestinations;

// This should (due to external logic) only include pending payments
for (int i = start; i < p_pendingPayments.size() && i < stop; i++) {
for (int i = start; i < (int)p_pendingPayments.size() && i < stop; i++) {
expectedCount++;

// Parse Raven address (already validated during ownership snapshot creation)
Expand Down Expand Up @@ -343,7 +342,7 @@ bool BuildTransaction(
GetMyAssetBalance(p_rewardSnapshot.strDistributionAsset, totalAssetBalance, 0);

// This should (due to external logic) only include pending payments
for (int i = start; i < p_pendingPayments.size() && i < stop; i++) {
for (int i = start; i < (int)p_pendingPayments.size() && i < stop; i++) {
expectedCount++;

vDestinations.emplace_back(std::make_pair(
Expand Down
Loading