Skip to content

Commit

Permalink
Merge pull request #604 from eoscommunity/main
Browse files Browse the repository at this point in the history
EdenOS Release 0.2.23
  • Loading branch information
brandonfancher authored Nov 11, 2021
2 parents d3c7bfb + 217d9a6 commit a2f0c3a
Show file tree
Hide file tree
Showing 107 changed files with 3,430 additions and 1,718 deletions.
148 changes: 81 additions & 67 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ jobs:
- name: show_cache
if: steps.filter.outputs.src == 'true'
id: show_cache
run: echo "${{ runner.os }}-ccache_whole-${{ steps.ccache_cache_timestamp.outputs.timestamp }}"
run: |
echo "${{ runner.os }}-ccache_whole-${{ steps.ccache_cache_timestamp.outputs.timestamp }}"
echo "${{ runner.os }}-product_cache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}"
- name: ccache cache files
if: steps.filter.outputs.src == 'true'
Expand All @@ -84,6 +86,14 @@ jobs:
restore-keys: |
${{ runner.os }}-ccache_whole-
- name: product cache files
uses: actions/[email protected]
with:
path: product_cache
key: ${{ runner.os }}-product_cache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
${{ runner.os }}-product_cache-
- name: 🛠 Build
if: steps.filter.outputs.src == 'true'
run: |
Expand All @@ -104,6 +114,22 @@ jobs:
make -j$(nproc)
tar czf clsdk-ubuntu-20-04.tar.gz clsdk
rm -rf ../product_cache
mkdir -p ../product_cache
cp clsdk-ubuntu-20-04.tar.gz ../product_cache
cp atomicassets.abi ../product_cache
cp atomicassets.wasm ../product_cache
cp atomicmarket.abi ../product_cache
cp atomicmarket.wasm ../product_cache
cp bios.wasm ../product_cache
cp boot.wasm ../product_cache
cp eden-micro-chain.wasm ../product_cache
cp eden.abi ../product_cache
cp eden.wasm ../product_cache
cp run-full-election.wasm ../product_cache
cp run-genesis.wasm ../product_cache
cp token.abi ../product_cache
cp token.wasm ../product_cache
echo =====
ls -la ${GITHUB_WORKSPACE}
Expand All @@ -124,22 +150,38 @@ jobs:
ccache.log
- name: 📃 Upload clsdk
if: steps.filter.outputs.src == 'true'
uses: actions/upload-artifact@v2
with:
name: clsdk
path: |
build/clsdk-ubuntu-20-04.tar.gz
product_cache/clsdk-ubuntu-20-04.tar.gz
- name: 📃 Upload Eden Smart Contract
if: steps.filter.outputs.src == 'true'
uses: actions/upload-artifact@v2
with:
name: Eden Smart Contract
path: |
build/eden.abi
build/eden.wasm
build/eden-micro-chain.wasm
product_cache/eden.abi
product_cache/eden.wasm
product_cache/eden-micro-chain.wasm
- name: 📃 Upload Ephemeral Eden Chains Runners
uses: actions/upload-artifact@v2
with:
name: Ephemeral Eden Chains Runners
path: |
product_cache/atomicassets.abi
product_cache/atomicassets.wasm
product_cache/atomicmarket.abi
product_cache/atomicmarket.wasm
product_cache/bios.wasm
product_cache/boot.wasm
product_cache/eden.abi
product_cache/eden.wasm
product_cache/token.abi
product_cache/token.wasm
product_cache/run-genesis.wasm
product_cache/run-full-election.wasm
build-micro-chain:
name: Build Micro Chain
Expand Down Expand Up @@ -211,57 +253,6 @@ jobs:
path: |
build/eden-micro-chain.wasm
box-e2e:
needs: build-micro-chain
name: Eden Box E2E Tests
runs-on: ubuntu-latest

steps:
- name: ✅ Checkout code
uses: actions/checkout@v2

- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
src:
- ".github/workflows/build.yml"
- ".eslintignore"
- ".eslintrc.js"
- ".prettierrc.json"
- "lerna.json"
- "package.json"
- "packages/common/**"
- "tsconfig.build.json"
- "tsconfig.json"
- "yarn.lock"
- "docker/eden-box.Dockerfile"
- "packages/box/**"
- name: Download Eden Microchain
if: steps.filter.outputs.src == 'true'
uses: actions/download-artifact@v2
with:
name: Eden Microchain
path: build

- name: 🛠 Build and Start Box
if: steps.filter.outputs.src == 'true'
run: |
export DFUSE_PREVENT_CONNECT=1
yarn
yarn build --stream
cd packages/box
yarn start &
- name: 🧪 Run E2E
if: steps.filter.outputs.src == 'true'
# TODO: add real E2E tests... for now it's just a shameless curl ping
run: |
curl localhost:3032
box-build:
needs: build-micro-chain
name: Build Eden Box
Expand Down Expand Up @@ -336,9 +327,9 @@ jobs:
tags: ${{ steps.prep.outputs.tags }}
context: .

webapp-e2e:
needs: build-micro-chain
name: WebApp E2E Tests
e2e:
needs: [build-cpp, build-micro-chain]
name: E2E Tests
environment: e2e_tests
runs-on: ubuntu-latest

Expand All @@ -363,8 +354,8 @@ jobs:
- "tsconfig.json"
- "yarn.lock"
- "docker/eden-webapp.Dockerfile"
- "packages/webapp/**"
- "packages/**"
- "contracts/**"
- name: Download Eden Microchain
if: steps.filter.outputs.src == 'true'
Expand All @@ -373,21 +364,45 @@ jobs:
name: Eden Microchain
path: build

- name: Download Ephemeral Chain Runners
if: steps.filter.outputs.src == 'true'
uses: actions/download-artifact@v2
with:
name: Ephemeral Eden Chains Runners
path: build

- name: Download clsdk
if: steps.filter.outputs.src == 'true'
uses: actions/download-artifact@v2
with:
name: clsdk
path: build

- name: Start Genesis Ephemeral Chain
if: steps.filter.outputs.src == 'true'
run: |
cp ./scripts/eden_chain_runner.sh ./build
cd build
tar -xvf clsdk-ubuntu-20-04.tar.gz clsdk/bin
ls -la
sh -x ./eden_chain_runner.sh run-genesis.wasm
- name: 🛠 Build and Start WebApp
if: steps.filter.outputs.src == 'true'
run: |
export DFUSE_PREVENT_CONNECT=1
export NODE_ENV=test
env
yarn
yarn build --stream --ignore @edenos/example-history-app
yarn start --stream --ignore @edenos/example-history-app &
yarn start-test --stream --ignore @edenos/example-history-app &
env:
IPFS_PINATA_JWT: ${{ secrets.IPFS_PINATA_JWT }}

- name: 🧪 Run E2E
if: steps.filter.outputs.src == 'true'
run: |
yarn test --stream
env:
cypress_test_users_pk: ${{ secrets.CYPRESS_TEST_USERS_PK }}
- name: 🎥 Upload Cypress Results
if: always() && steps.filter.outputs.src == 'true'
Expand Down Expand Up @@ -464,4 +479,3 @@ jobs:
file: docker/eden-webapp.Dockerfile
tags: ${{ steps.prep.outputs.tags }}
context: .

21 changes: 13 additions & 8 deletions contracts/eden/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,28 @@ add_custom_command(TARGET eden-abigen POST_BUILD
COMMAND ${ROOT_BINARY_DIR}/cltester eden-abigen.wasm >${ROOT_BINARY_DIR}/eden.abi
)

function(add_test_eden suffix)
add_executable(test-eden${suffix} tests/test-eden.cpp src/globals.cpp src/accounts.cpp src/members.cpp src/atomicassets.cpp src/elections.cpp)
target_include_directories(test-eden${suffix} PUBLIC include)
target_include_directories(test-eden${suffix} PUBLIC
function(add_test_eden test_file suffix)
add_executable(${test_file}${suffix} tests/${test_file}.cpp src/globals.cpp src/accounts.cpp src/members.cpp src/atomicassets.cpp src/elections.cpp)
target_include_directories(${test_file}${suffix} PUBLIC include)
target_include_directories(${test_file}${suffix} PUBLIC
../token/include
../boot/include
../../external/atomicassets-contract/include
../../libraries/clchain/include
./tests/include
)
target_link_libraries(test-eden${suffix} catch2 cltestlib${suffix})
set_target_properties(test-eden${suffix} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${ROOT_BINARY_DIR})
target_link_libraries(${test_file}${suffix} catch2 cltestlib${suffix})
set_target_properties(${test_file}${suffix} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${ROOT_BINARY_DIR})
endfunction()

add_test_eden("")
add_test_eden("-debug")
add_test_eden("test-eden" "")
add_test_eden("test-eden" "-debug")
eden_tester_test(test-eden)

# Chain Runners
add_test_eden("run-genesis" "")
add_test_eden("run-full-election" "")

file(CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/tests/data ${ROOT_BINARY_DIR}/eden-test-data SYMBOLIC)

function(add_eden_microchain suffix)
Expand Down
3 changes: 0 additions & 3 deletions contracts/eden/include/eden.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ namespace eden

void donate(eosio::name payer, const eosio::asset& quantity);

void transfer(eosio::name to, const eosio::asset& quantity, const std::string& memo);

void genesis(std::string community,
eosio::symbol community_symbol,
eosio::asset minimum_donation,
Expand Down Expand Up @@ -195,7 +193,6 @@ namespace eden
"eden.gm"_n,
action(withdraw, owner, quantity, ricardian_contract(withdraw_ricardian)),
action(donate, owner, quantity),
action(transfer, to, quantity, memo),
action(fundtransfer, from, distribution_time, rank, to, amount, memo),
action(usertransfer, from, to, amount, memo),
action(genesis,
Expand Down
14 changes: 0 additions & 14 deletions contracts/eden/src/actions/accounts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,6 @@ namespace eden
}
}

void eden::transfer(eosio::name to, const eosio::asset& quantity, const std::string& memo)
{
require_auth(get_self());
accounts internal{get_self(), "owned"_n};
setup_distribution(get_self(), internal);
internal.sub_balance("master"_n, quantity);
accounts{get_self(), "outgoing"_n}.add_balance(to, quantity, false);
eosio::action{{get_self(), "active"_n},
token_contract,
"transfer"_n,
std::tuple(get_self(), to, quantity, memo)}
.send();
}

void eden::withdraw(eosio::name owner, const eosio::asset& quantity)
{
require_auth(owner);
Expand Down
Loading

0 comments on commit a2f0c3a

Please sign in to comment.