Skip to content

Commit

Permalink
[Dockerfile] Add missing include (#3061)
Browse files Browse the repository at this point in the history
  • Loading branch information
hewigovens authored Apr 11, 2023
1 parent 5e26895 commit b8a050d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 22 deletions.
1 change: 1 addition & 0 deletions .dockerignore
3 changes: 0 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ name: Docker CI
on:
push:
branches: [ master ]
paths:
- Dockerfile
- tools/install-dependencies
pull_request:
branches: [ master ]
paths:
Expand Down
27 changes: 9 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ RUN apt-get update \
software-properties-common \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

# Add latest cmake/boost
# Add latest cmake
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc | apt-key add - \
&& apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'


RUN wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.17_amd64.deb && dpkg -i ./libssl1.1_1.1.1f-1ubuntu2.17_amd64.deb

# Install required packages for dev
Expand Down Expand Up @@ -50,31 +49,23 @@ RUN cargo install --force cbindgen \
# ↑ Setup build environment
# ↓ Build and compile wallet core

RUN git clone https://github.com/trustwallet/wallet-core.git
COPY . /wallet-core
WORKDIR /wallet-core

# Install dependencies
RUN tools/install-dependencies

# Build: generate, cmake, and make lib
RUN tools/generate-files \
&& cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug \
# Build: generate files and rust lib
RUN tools/generate-files

# Build: cmake + make wallet core
RUN cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug \
&& make -Cbuild -j12 TrustWalletCore

# Build unit tester
RUN make -Cbuild -j12 tests

# Download and Install Go
ENV GO_VERSION=1.16.12
ENV GO_ARCH=amd64
RUN wget "https://golang.org/dl/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz" \
&& tar -xf "go${GO_VERSION}.linux-${GO_ARCH}.tar.gz" \
&& chown -R root:root ./go \
&& mv -v ./go /usr/local \
&& ls /usr/local/go \
&& /usr/local/go/bin/go version \
&& rm "go${GO_VERSION}.linux-${GO_ARCH}.tar.gz"

# Building GoLang sample app: cd samples/go && /usr/local/go/bin/go build -o main && ./main
# Download and Install Go: apt install golang-go
# Build Go sample app: cd samples/go && /usr/local/go/bin/go build -o main && ./main

CMD ["/bin/bash"]
3 changes: 2 additions & 1 deletion src/Nebulas/Address.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "../Base58.h"
#include "../Hash.h"
#include "../HexCoding.h"
#include <cstring>

namespace TW::Nebulas {

Expand All @@ -27,7 +28,7 @@ bool Address::isValid(const std::string& string) {
Data content(data.begin(), data.begin() + 22);
Data checksum(data.begin() + 22, data.end());
auto dataSha3 = Hash::sha3_256(content);
return ::memcmp(dataSha3.data(), checksum.data(), 4) == 0;
return std::memcmp(dataSha3.data(), checksum.data(), 4) == 0;
}

Address::Address(const std::string& string) {
Expand Down

0 comments on commit b8a050d

Please sign in to comment.