Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Limit Order Modification Feature #2743

Merged
merged 31 commits into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
61d85de
Progress #1604: Basic implementation
nathanielhourt Feb 21, 2019
f6bbe4b
Progress #1604: Tests and Fixes
nathanielhourt Feb 22, 2019
5484c9f
Ref #1604: Add matching logic
nathanielhourt Feb 22, 2019
3d24f7c
Progress #1604: Add dust check
nathanielhourt Feb 26, 2019
073ecbe
Progress #1604: Add hardfork guards
nathanielhourt Feb 26, 2019
a34c855
Ref #1604: Another test case
nathanielhourt Feb 26, 2019
fba5bac
Progress #1604: Do not allow sooner expiration
nathanielhourt Feb 27, 2019
8a82d92
Add fee_schedule::exists<op_type>()
nathanielhourt Feb 27, 2019
6180946
Ref #1604: Add missing hardfork guard
nathanielhourt Feb 27, 2019
55dc688
Eliminate variable fee
nathanielhourt Oct 7, 2019
a71cfe4
Merge hardfork branch, fix build and tests
abitmore Apr 29, 2023
a03b4ce
Fix issues about limit_order_update_evaluator
abitmore May 8, 2023
44e6de4
Do not allow inappropriate price manipulation
abitmore May 9, 2023
2387df3
Remove redundant checks for order matching
abitmore May 9, 2023
2b3bcd3
Remove redundant checks for account balance
abitmore May 9, 2023
e8e9d0d
Simplify try-catch wrappers in tests
abitmore May 9, 2023
136007e
Update tests to adapt code changes
abitmore May 10, 2023
cf2fca6
Remove mostly useless try/catch wrappers
abitmore May 10, 2023
9160a7e
Add tests for limit_order_update_operation
abitmore May 10, 2023
c58db0b
Fix potential dereferencing issues in tests
abitmore May 10, 2023
85bef43
Add asset authorization tests for order_update op
abitmore May 10, 2023
afcff0d
Update a comment and an assertion message
abitmore May 10, 2023
dfce7c6
Update default order update fee
abitmore May 11, 2023
8898b5a
Process operation fees
abitmore May 11, 2023
269a16d
Reduce log level of exceptions in order_update_op
abitmore May 11, 2023
032f125
Update a comment
abitmore May 12, 2023
663ecd9
Move deferred fee processing code into a function
abitmore May 12, 2023
d381110
Add tests for order_update fee if paid in CORE
abitmore May 12, 2023
1195df5
Add tests for order_update fee if not paid in CORE
abitmore May 12, 2023
2a34e1b
Update variable names to fix variable shadowing
abitmore May 15, 2023
126987e
Update a comment
abitmore May 15, 2023
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
  •  
  •  
  •  
Prev Previous commit
Next Next commit
Merge hardfork branch, fix build and tests
Resolved conflicts:
- libraries/chain/include/graphene/chain/market_evaluator.hpp
- libraries/chain/include/graphene/chain/protocol/fee_schedule.hpp
- libraries/chain/include/graphene/chain/protocol/operations.hpp
- libraries/chain/proposal_evaluator.cpp
- libraries/protocol/include/graphene/protocol/market.hpp
- tests/common/database_fixture.cpp
  • Loading branch information
abitmore committed Apr 29, 2023
commit a71cfe4fb65c6054b40b58d425fd2bdf6df2a321
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Set the default behavior of genesis.json, in case core.autocrlf is set incorrectly
genesis.json eol=lf
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
target-branch: "develop"
85 changes: 85 additions & 0 deletions .github/workflows/build-and-test.mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: macOS
on: [ push, pull_request ]
env:
CCACHE_COMPRESS: exists means true
CCACHE_SLOPPINESS: include_file_ctime,include_file_mtime,time_macros
jobs:
build-osx:
name: Build and test in macOS
strategy:
matrix:
os: [macos-11]
runs-on: ${{ matrix.os }}
steps:
- name: Install dependencies
run: |
brew install autoconf automake libtool
brew install ccache
brew install parallel
brew install bitshares/boost/[email protected]
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Configure
run: |
mkdir -p _build
pushd _build
cmake -D CMAKE_BUILD_TYPE=Release \
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
-D BOOST_ROOT=/usr/local/opt/[email protected] \
-D OPENSSL_ROOT_DIR=/usr/local/opt/[email protected] \
..
- name: Load Cache
uses: actions/cache@v3
with:
path: ccache
key: ccache-${{ matrix.os }}-${{ github.ref }}-${{ github.sha }}
restore-keys: |
ccache-${{ matrix.os }}-${{ github.ref }}-
ccache-${{ matrix.os }}-
- name: Build
run: |
export CCACHE_DIR="$GITHUB_WORKSPACE/ccache"
mkdir -p "$CCACHE_DIR"
make -j 3 -C _build witness_node cli_wallet app_test cli_test chain_test
df -h
- name: Unit-Tests
timeout-minutes: 15
run: |
_build/tests/app_test -l test_suite
libraries/fc/tests/run-parallel-tests.sh _build/tests/chain_test -l test_suite
_build/tests/cli_test -l test_suite
df -h
- name: Quick test for program arguments
run: |
_build/programs/witness_node/witness_node --version
_build/programs/witness_node/witness_node --help
if _build/programs/witness_node/witness_node --bad-arg ; then \
echo "Fail: did not get expected error."; false; \
else \
echo "Pass: got expected error."; \
fi
if _build/programs/witness_node/witness_node --plugins "account_history elasticsearch" ; then \
echo "Fail: did not get expected error."; false; \
else \
echo "Pass: got expected error."; \
fi
if _build/programs/witness_node/witness_node --rpc-endpoint --plugins "witness"; then \
echo "Fail: did not get expected error."; false; \
else \
echo "Pass: got expected error."; \
fi
_build/programs/cli_wallet/cli_wallet --version
_build/programs/cli_wallet/cli_wallet --help
_build/programs/cli_wallet/cli_wallet --suggest-brain-key
if _build/programs/cli_wallet/cli_wallet --bad-arg ; then \
echo "Fail: did not get expected error."; false; \
else \
echo "Pass: got expected error."; \
fi
- name: Node-Test
run: |
df -h
pushd _build
../programs/build_helpers/run-node-test
161 changes: 161 additions & 0 deletions .github/workflows/build-and-test.ubuntu-debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
name: Ubuntu Debug
on: [ push, pull_request ]
env:
CCACHE_COMPRESS: exists means true
CCACHE_SLOPPINESS: include_file_ctime,include_file_mtime,time_macros
jobs:
test-debug:
name: Build and test in Debug mode
strategy:
matrix:
os: [ ubuntu-20.04 ]
runs-on: ${{ matrix.os }}
services:
elasticsearch8:
image: elastic/elasticsearch:8.6.1
options: >-
--env ES_JAVA_OPTS="-Xms512m -Xmx512m"
--env discovery.type=single-node
--env xpack.security.enabled=false
--env xpack.security.http.ssl.enabled=false
--env action.destructive_requires_name=false
--env cluster.routing.allocation.disk.threshold_enabled=false
--publish 9200:9200
elasticsearch7:
image: elastic/elasticsearch:7.17.9
options: >-
--env ES_JAVA_OPTS="-Xms512m -Xmx512m"
--env discovery.type=single-node
--env cluster.routing.allocation.disk.threshold_enabled=false
--publish 9201:9200
steps:
- name: Install dependencies
run: |
df -h
sudo apt-get update
openssl_ver=`sudo apt-cache madison openssl | grep xenial-updates | awk '{print $3}'`
libssl_ver=`sudo apt-cache madison libssl-dev | grep xenial-updates | awk '{print $3}'`
[ -n "${openssl_ver}" ] && [ -n "${libssl_ver}" ] && \
sudo apt-get install -y --allow-downgrades openssl=${openssl_ver} libssl-dev=${libssl_ver}
sudo apt-get install -y \
ccache \
parallel \
libboost-thread-dev \
libboost-iostreams-dev \
libboost-date-time-dev \
libboost-system-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-chrono-dev \
libboost-test-dev \
libboost-context-dev \
libboost-regex-dev \
libboost-coroutine-dev \
libcurl4-openssl-dev
sudo apt-get auto-remove -y
sudo apt-get clean -y
df -h
sudo du -hs /mnt/*
sudo ls -alr /mnt/
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Configure
run: |
pwd
df -h .
free
mkdir -p _build
sudo mkdir -p /_build/libraries /_build/programs /_build/tests /mnt/_build
sudo chmod a+rwx /_build/libraries /_build/programs /_build/tests
ln -s /_build/libraries _build/libraries
ln -s /_build/programs _build/programs
ln -s /_build/tests _build/tests
sudo ln -s /_build/libraries /mnt/_build/libraries
sudo ln -s /_build/programs /mnt/_build/programs
sudo ln -s /_build/tests /mnt/_build/tests
ls -al _build
pushd _build
export -n BOOST_ROOT BOOST_INCLUDEDIR BOOST_LIBRARYDIR
cmake -D CMAKE_BUILD_TYPE=Debug \
-D CMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON \
-D CMAKE_C_COMPILER=gcc \
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
-D CMAKE_CXX_COMPILER=g++ \
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
..
popd
- name: Load Cache
uses: actions/cache@v3
with:
path: ccache
key: ccache-debug-${{ matrix.os }}-${{ github.ref }}-${{ github.sha }}
restore-keys: |
ccache-debug-${{ matrix.os }}-${{ github.ref }}-
ccache-debug-${{ matrix.os }}-
- name: Build
run: |
export CCACHE_DIR="$GITHUB_WORKSPACE/ccache"
mkdir -p "$CCACHE_DIR"
df -h
make -j 2 -C _build chain_test
make -j 2 -C _build cli_test
make -j 2 -C _build app_test
make -j 2 -C _build es_test
make -j 2 -C _build cli_wallet
make -j 2 -C _build witness_node
make -j 2 -C _build
df -h
du -hs _build/libraries/* _build/programs/* _build/tests/*
du -hs _build/*
du -hs /_build/*
- name: Unit-Tests
timeout-minutes: 15
run: |
_build/tests/app_test -l test_suite
df -h
rm -rf /tmp/graphene*
_build/tests/es_test -l test_suite
export GRAPHENE_TESTING_ES_URL=http://127.0.0.1:9201/
_build/tests/es_test -l test_suite
df -h
rm -rf /tmp/graphene*
libraries/fc/tests/run-parallel-tests.sh _build/tests/chain_test -l test_suite
df -h
rm -rf /tmp/graphene*
_build/tests/cli_test -l test_suite
df -h
rm -rf /tmp/graphene*
- name: Quick test for program arguments
run: |
_build/programs/witness_node/witness_node --version
_build/programs/witness_node/witness_node --help
if _build/programs/witness_node/witness_node --bad-arg ; then \
echo "Fail: did not get expected error."; false; \
else \
echo "Pass: got expected error."; \
fi
if _build/programs/witness_node/witness_node --plugins "account_history elasticsearch" ; then \
echo "Fail: did not get expected error."; false; \
else \
echo "Pass: got expected error."; \
fi
if _build/programs/witness_node/witness_node --rpc-endpoint --plugins "witness"; then \
echo "Fail: did not get expected error."; false; \
else \
echo "Pass: got expected error."; \
fi
_build/programs/cli_wallet/cli_wallet --version
_build/programs/cli_wallet/cli_wallet --help
_build/programs/cli_wallet/cli_wallet --suggest-brain-key
if _build/programs/cli_wallet/cli_wallet --bad-arg ; then \
echo "Fail: did not get expected error."; false; \
else \
echo "Pass: got expected error."; \
fi
- name: Node-Test
run: |
df -h
pushd _build
../programs/build_helpers/run-node-test
df -h
131 changes: 131 additions & 0 deletions .github/workflows/build-and-test.ubuntu-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
name: Ubuntu Release
on: [ push, pull_request ]
env:
CCACHE_COMPRESS: exists means true
CCACHE_SLOPPINESS: include_file_ctime,include_file_mtime,time_macros
jobs:
test-release:
name: Build and test in Release mode
strategy:
matrix:
os: [ ubuntu-20.04 ]
runs-on: ${{ matrix.os }}
services:
elasticsearch8:
image: elastic/elasticsearch:8.6.1
options: >-
--env ES_JAVA_OPTS="-Xms512m -Xmx512m"
--env discovery.type=single-node
--env xpack.security.enabled=false
--env xpack.security.http.ssl.enabled=false
--env action.destructive_requires_name=false
--env cluster.routing.allocation.disk.threshold_enabled=false
--publish 9200:9200
elasticsearch7:
image: elastic/elasticsearch:7.17.9
options: >-
--env ES_JAVA_OPTS="-Xms512m -Xmx512m"
--env discovery.type=single-node
--env cluster.routing.allocation.disk.threshold_enabled=false
--publish 9201:9200
steps:
- name: Install dependencies
run: |
sudo apt-get update
openssl_ver=`sudo apt-cache madison openssl | grep xenial-updates | awk '{print $3}'`
libssl_ver=`sudo apt-cache madison libssl-dev | grep xenial-updates | awk '{print $3}'`
[ -n "${openssl_ver}" ] && [ -n "${libssl_ver}" ] && \
sudo apt-get install -y --allow-downgrades openssl=${openssl_ver} libssl-dev=${libssl_ver}
sudo apt-get install -y \
ccache \
parallel \
libboost-thread-dev \
libboost-iostreams-dev \
libboost-date-time-dev \
libboost-system-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-chrono-dev \
libboost-test-dev \
libboost-context-dev \
libboost-regex-dev \
libboost-coroutine-dev \
libcurl4-openssl-dev
sudo apt-get auto-remove -y
sudo apt-get clean -y
df -h
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Configure
run: |
df -h
free
mkdir -p _build
pushd _build
export -n BOOST_ROOT BOOST_INCLUDEDIR BOOST_LIBRARYDIR
cmake -D CMAKE_BUILD_TYPE=Release \
-D CMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON \
-D CMAKE_C_COMPILER=gcc \
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
-D CMAKE_CXX_COMPILER=g++ \
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
..
popd
- name: Load Cache
uses: actions/cache@v3
with:
path: ccache
key: ccache-release-${{ matrix.os }}-${{ github.ref }}-${{ github.sha }}
restore-keys: |
ccache-release-${{ matrix.os }}-${{ github.ref }}-
ccache-release-${{ matrix.os }}-
- name: Build
run: |
export CCACHE_DIR="$GITHUB_WORKSPACE/ccache"
mkdir -p "$CCACHE_DIR"
make -j 2 -C _build
df -h
- name: Unit-Tests
timeout-minutes: 15
run: |
_build/tests/app_test -l test_suite
_build/tests/es_test -l test_suite
export GRAPHENE_TESTING_ES_URL=http://127.0.0.1:9201/
_build/tests/es_test -l test_suite
libraries/fc/tests/run-parallel-tests.sh _build/tests/chain_test -l test_suite
_build/tests/cli_test -l test_suite
df -h
- name: Quick test for program arguments
run: |
_build/programs/witness_node/witness_node --version
_build/programs/witness_node/witness_node --help
if _build/programs/witness_node/witness_node --bad-arg ; then \
echo "Fail: did not get expected error."; false; \
else \
echo "Pass: got expected error."; \
fi
if _build/programs/witness_node/witness_node --plugins "account_history elasticsearch" ; then \
echo "Fail: did not get expected error."; false; \
else \
echo "Pass: got expected error."; \
fi
if _build/programs/witness_node/witness_node --rpc-endpoint --plugins "witness"; then \
echo "Fail: did not get expected error."; false; \
else \
echo "Pass: got expected error."; \
fi
_build/programs/cli_wallet/cli_wallet --version
_build/programs/cli_wallet/cli_wallet --help
_build/programs/cli_wallet/cli_wallet --suggest-brain-key
if _build/programs/cli_wallet/cli_wallet --bad-arg ; then \
echo "Fail: did not get expected error."; false; \
else \
echo "Pass: got expected error."; \
fi
- name: Node-Test
run: |
df -h
pushd _build
../programs/build_helpers/run-node-test
df -h
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.