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

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: EOSIO/eosjs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v21.0.4
Choose a base ref
...
head repository: EOSIO/eosjs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 6,965 additions and 2,104 deletions.
  1. +5 −29 .github/dependabot.yml
  2. +66 −77 .github/eosjs-ci/Dockerfile
  3. +35 −0 .github/eosjs-ci/contracts/cfhello.cpp
  4. +156 −42 .github/eosjs-ci/scripts/deploy_contracts.sh
  5. +0 −35 .github/workflows/build-docker-develop.yml
  6. +249 −0 .github/workflows/build-docker-images.yml
  7. +0 −38 .github/workflows/build-docker-release.yml
  8. +9 −9 .github/workflows/ci.yml
  9. +0 −49 .github/workflows/integration-test-develop.yml
  10. +0 −49 .github/workflows/integration-test-release.yml
  11. +678 −0 .github/workflows/integration-tests.yml
  12. +31 −8 .github/workflows/publish-edge.yml
  13. +41 −18 .github/workflows/publish-release.yml
  14. +3 −0 .gitignore
  15. +144 −12 cypress/integration/index.spec.js
  16. +2 −1 docs/basic-usage/00_browser.md
  17. +67 −2 docs/how-to-guides/01_how-to-submit-a-transaction.md
  18. +60 −0 docs/how-to-guides/09_how-to-get-table-information.md
  19. +31 −0 docs/how-to-guides/20_how-to-set-a-payer.md
  20. +72 −0 docs/troubleshooting/02_rpcerror.md
  21. +25 −16 package.json
  22. +3 −3 src/PrivateKey.ts
  23. +0 −193 src/abi.abi.json
  24. +131 −1 src/eosjs-api-interfaces.ts
  25. +346 −34 src/eosjs-api.ts
  26. +4 −4 src/eosjs-ecc-migration.ts
  27. +156 −23 src/eosjs-jsonrpc.ts
  28. +5 −4 src/eosjs-jssig.ts
  29. +5 −5 src/eosjs-key-conversions.ts
  30. +21 −21 src/eosjs-numeric.ts
  31. +492 −14 src/eosjs-rpc-interfaces.ts
  32. +6 −0 src/eosjs-rpcerror.ts
  33. +588 −71 src/eosjs-serialize.ts
  34. +5 −4 src/eosjs-webauthn-sig.ts
  35. +133 −3 src/tests/eosjs-api.test.ts
  36. +130 −0 src/tests/eosjs-jsonrpc.test.ts
  37. +198 −3 src/tests/node.js
  38. +72 −0 src/tests/node.test.ts
  39. +1,307 −0 src/tests/type-checks.test.ts
  40. +408 −12 src/tests/web.html
  41. +0 −117 src/transaction.abi.json
  42. +12 −0 webpack.debug.js
  43. +14 −0 webpack.prod.js
  44. +1,255 −1,207 yarn.lock
34 changes: 5 additions & 29 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -4,41 +4,17 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
target-branch: "master"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
target-branch: "develop"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
target-branch: "release/21.0.x"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
target-branch: "release/22.0.x"

- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
target-branch: "develop"

- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
target-branch: "release/21.0.x"

- package-ecosystem: "npm"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
target-branch: "release/22.0.x"
interval: "weekly"
target-branch: "release/22.1.x"
143 changes: 66 additions & 77 deletions .github/eosjs-ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,89 +1,78 @@
FROM ubuntu:18.04
ENTRYPOINT ["nodeos", "--data-dir", "/root/.local/share", "-e", "-p", "eosio", "--replay-blockchain", "--plugin", "eosio::producer_plugin", "--plugin", "eosio::chain_api_plugin", "--plugin", "eosio::http_plugin", "--http-server-address=0.0.0.0:8888", "--access-control-allow-origin=*", "--contracts-console", "--http-validate-host=false", "--verbose-http-errors", "--max-transaction-time=100"]
### Test:
#### docker build --tag eosjs-ci:test ./.github/eosjs-ci
#### docker run --publish 8888:8888 eosjs-ci:test

### base
RUN yes | unminimize \
&& apt-get update \
&& apt-get install -yq \
binutils-gold \
build-essential \
clang-tools-8 \
curl \
g++-8 \
git \
libcurl4-gnutls-dev \
libgflags-dev \
libgmp3-dev \
libssl-dev \
libusb-1.0-0-dev \
lld-8 \
llvm-7 \
llvm-7-dev \
locales \
ninja-build \
pkg-config \
python \
software-properties-common \
wget \
xz-utils \
zlib1g-dev \
&& update-alternatives --remove-all cc \
&& update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-8 100 \
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 100 \
&& update-alternatives --remove-all c++ \
&& update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-8 100 \
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 100 \
&& update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-8 100 \
&& locale-gen en_US.UTF-8 \
&& curl -sL https://deb.nodesource.com/setup_10.x | bash -

ENV LANG=en_US.UTF-8

### cmake
ARG EOSBRANCH=develop
ARG CDTBRANCH=develop
FROM eosio/eosio.cdt:${CDTBRANCH} as contracts
ARG CDTBRANCH
WORKDIR /root
RUN curl -LO https://cmake.org/files/v3.13/cmake-3.13.2.tar.gz \
&& tar -xzf cmake-3.13.2.tar.gz \
&& cd cmake-3.13.2 \
&& ./bootstrap --prefix=/usr/local --parallel=8 \
&& make -j8 \
&& make install \
&& cd /root \
&& rm -rf cmake-3.13.2.tar.gz cmake-3.13.2
RUN apt-get update \
&& apt-get install -yq curl git

### boost
RUN curl -LO https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.bz2 \
&& tar -xjf boost_1_72_0.tar.bz2 \
&& cd boost_1_72_0 \
&& ./bootstrap.sh --prefix=/usr/local \
&& ./b2 --with-iostreams --with-date_time --with-filesystem --with-system --with-program_options --with-chrono --with-test -j$(nproc) install \
&& cd /root \
&& rm -rf boost_1_72_0.tar.bz2 boost_1_72_0
RUN if [ "$CDTBRANCH" = "release_1.7.x" ]; then \
git clone https://github.com/EOSIO/tropical-example-web-app \
&& mkdir -p /root/contracts/eosio.bios_v1.8.3 && mv ./tropical-example-web-app/eosio/contracts/eosio.bios-v1.8.3/* /root/contracts/eosio.bios_v1.8.3/ \

### eosio.cdt
RUN git clone https://github.com/EOSIO/eosio.cdt.git \
&& cd eosio.cdt \
&& git checkout eosio-cdt-2.1-staging-c \
&& git submodule update --init --recursive \
&& mkdir build \
&& cd build \
&& cmake -GNinja .. \
&& ninja -j8
&& git clone https://github.com/EOSIO/eos \
&& cd eos \
&& git checkout v2.0.12 \
&& mkdir -p /root/contracts/eosio.bios/ && mv ./unittests/contracts/eosio.bios/* /root/contracts/eosio.bios/ \
&& mkdir -p /root/contracts/eosio.system/ && mv ./unittests/contracts/eosio.system/* /root/contracts/eosio.system/ \
&& mkdir -p /root/contracts/eosio.msig/ && mv ./unittests/contracts/eosio.msig/* /root/contracts/eosio.msig/ \
&& mkdir -p /root/contracts/eosio.token/ && mv ./unittests/contracts/eosio.token/* /root/contracts/eosio.token/ \
; fi

### eos
RUN git clone https://github.com/EOSIO/eos.git \
RUN if [ "$CDTBRANCH" = "release_1.8.x" ] || [ "$CDTBRANCH" = "develop" ]; then \
git clone https://github.com/EOSIO/eos \
&& cd eos \
&& git checkout develop \
&& git submodule update --init --recursive \
&& mkdir build \
&& cd build \
&& CC=clang-8 CXX=clang++-8 cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_AR=/usr/bin/llvm-ar-8 -DCMAKE_RANLIB=/usr/bin/llvm-ranlib-8 -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld .. \
&& CC=clang-8 CXX=clang++-8 ninja -j8
&& mkdir -p /root/contracts/eosio.bios/ && mv ./contracts/contracts/eosio.bios/bin/* /root/contracts/eosio.bios/ \
&& mkdir -p /root/contracts/eosio.boot/ && mv ./contracts/contracts/eosio.boot/bin/* /root/contracts/eosio.boot/ \
&& mkdir -p /root/contracts/eosio.system/ && mv ./unittests/contracts/eosio.system/* /root/contracts/eosio.system/ \
&& mkdir -p /root/contracts/eosio.msig/ && mv ./unittests/contracts/eosio.msig/* /root/contracts/eosio.msig/ \
&& mkdir -p /root/contracts/eosio.token/ && mv ./unittests/contracts/eosio.token/* /root/contracts/eosio.token/ \
&& mkdir -p /root/contracts/nested_container_kv/ && mv ./unittests/test-contracts/nested_container_kv/* /root/contracts/nested_container_kv \
&& mkdir -p /root/contracts/nested_container_multi_index/ && mv ./unittests/test-contracts/nested_container_multi_index/* /root/contracts/nested_container_multi_index \
; fi

RUN if [ "$CDTBRANCH" = "release_1.8.x" ] || [ "$CDTBRANCH" = "develop" ]; then \
git clone https://github.com/EOSIO/eosio.cdt \
&& cd eosio.cdt \
&& git checkout develop \
&& mkdir -p build/read_only_query_tests/ \
&& eosio-cpp -abigen ./tests/unit/test_contracts/read_only_query_tests.cpp -o ./build/read_only_query_tests/read_only_query_tests.wasm \
&& mkdir -p /root/contracts/read_only_query_tests/ && mv ./build/read_only_query_tests/* /root/contracts/read_only_query_tests/ \
; fi

ENV PATH="/root/eos/build/bin/:/root/eosio.cdt/build/bin/:${PATH}"
RUN if [ "$CDTBRANCH" = "release_1.8.x" ] || [ "$CDTBRANCH" = "develop" ]; then \
git clone https://github.com/EOSIO/key-value-example-app.git \
&& cd key-value-example-app \
&& eosio-cpp -abigen ./contracts/kv_todo/src/kv_todo.cpp -o ./contracts/kv_todo/build/kv_todo.wasm -R ./contracts/kv_todo/ricardian/ -I ./contracts/kv_todo/include/ \
&& mkdir -p /root/contracts/kv_todo/ && mv ./contracts/kv_todo/build/* /root/contracts/kv_todo/ \
; fi

RUN mkdir -p "/opt/eosio/bin/contracts"
RUN if [ "$CDTBRANCH" = "release_1.8.x" ] || [ "$CDTBRANCH" = "develop" ]; then \
git clone https://github.com/EOSIO/return-values-example-app.git \
&& cd return-values-example-app \
&& eosio-cpp -abigen ./contracts/action_return_value/src/action_return_value.cpp -o ./contracts/action_return_value/build/action_return_value.wasm -R ./contracts/action_return_value/ricardian/ \
&& mkdir -p /root/contracts/action_return_value/ && mv ./contracts/action_return_value/build/* /root/contracts/action_return_value/ \
; fi

COPY ./ /opt/eosio/bin
RUN mkdir cfhello
COPY ./contracts/cfhello.cpp /root/cfhello
RUN cd cfhello \
&& mkdir build \
&& eosio-cpp -abigen ./cfhello.cpp -o ./build/cfhello.wasm \
&& mkdir -p /root/contracts/cfhello/ && mv ./build/* /root/contracts/cfhello/

FROM eosio/eosio:${EOSBRANCH}
ARG EOSBRANCH
ENTRYPOINT ["nodeos", "--data-dir", "/root/.local/share", "-e", "-p", "eosio", "--replay-blockchain", "--plugin", "eosio::producer_plugin", "--plugin", "eosio::producer_api_plugin", "--plugin", "eosio::chain_api_plugin", "--plugin", "eosio::trace_api_plugin", "--trace-no-abis", "--plugin", "eosio::db_size_api_plugin", "--plugin", "eosio::http_plugin", "--http-server-address=0.0.0.0:8888", "--access-control-allow-origin=*", "--contracts-console", "--http-validate-host=false", "--enable-account-queries=true", "--verbose-http-errors", "--max-transaction-time=100"]
WORKDIR /root
RUN mkdir -p "/opt/eosio/bin/contracts"
COPY --from=contracts /root/contracts /opt/eosio/bin/contracts/
COPY ./ /opt/eosio/bin/

RUN mkdir -p "/opt/eosio/bin/config-dir"
RUN /bin/bash /opt/eosio/bin/scripts/deploy_contracts.sh
RUN /bin/bash /opt/eosio/bin/scripts/deploy_contracts.sh "$EOSBRANCH"
35 changes: 35 additions & 0 deletions .github/eosjs-ci/contracts/cfhello.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Import necessary libraries
#include <eosio/eosio.hpp>
#include <eosio/transaction.hpp>

using namespace eosio;

class [[eosio::contract("cfhello")]] cfhello : public contract {
public:
using contract::contract;

[[eosio::action]]
void contextfree() {
int cfd_index = 0;
while(true) {
int read_size = get_context_free_data( cfd_index, nullptr, 0 );
if (read_size == -1) {
if (cfd_index == 0) {
print("No context free data found");
}
break;
}

char* context_free_data = new char[read_size];
get_context_free_data( cfd_index, context_free_data, read_size );

print("CFD ", std::to_string(cfd_index), ":", context_free_data, "\n");
cfd_index++;
}
}

[[eosio::action]]
void normal( name user ) {
print( "Hi, ", user);
}
};
Loading