diff options
-rw-r--r-- | .github/workflows/build.yml | 6 | ||||
-rw-r--r-- | .github/workflows/depends.yml | 2 | ||||
-rw-r--r-- | .github/workflows/gitian.yml | 49 | ||||
-rw-r--r-- | contrib/epee/src/portable_storage.cpp | 2 | ||||
-rw-r--r-- | src/wallet/api/wallet.cpp | 6 | ||||
-rw-r--r-- | src/wallet/wallet2.cpp | 8 |
6 files changed, 59 insertions, 14 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b327374d..e66cd4cde 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,7 +77,7 @@ jobs: CCACHE_TEMPDIR: /tmp/.ccache-temp strategy: matrix: - os: [ubuntu-latest, ubuntu-18.04] + os: [ubuntu-22.04, ubuntu-20.04] steps: - uses: actions/checkout@v1 with: @@ -101,7 +101,7 @@ jobs: ${{env.BUILD_DEFAULT_LINUX}} libwallet-ubuntu: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 env: CCACHE_TEMPDIR: /tmp/.ccache-temp steps: @@ -129,7 +129,7 @@ jobs: test-ubuntu: needs: build-ubuntu - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 env: CCACHE_TEMPDIR: /tmp/.ccache-temp steps: diff --git a/.github/workflows/depends.yml b/.github/workflows/depends.yml index 57e9e68bb..c05f74f9c 100644 --- a/.github/workflows/depends.yml +++ b/.github/workflows/depends.yml @@ -18,7 +18,7 @@ env: jobs: build-cross: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 env: CCACHE_TEMPDIR: /tmp/.ccache-temp strategy: diff --git a/.github/workflows/gitian.yml b/.github/workflows/gitian.yml new file mode 100644 index 000000000..6506e3d46 --- /dev/null +++ b/.github/workflows/gitian.yml @@ -0,0 +1,49 @@ +name: ci/gh-actions/gitian + +on: + push: + tags: + - '*' + +jobs: + build-gitian: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + operating-system: + - name: "Linux" + option: "l" + - name: "Windows" + option: "w" + - name: "Android" + option: "a" + - name: "FreeBSD" + option: "f" + - name: "macOS" + option: "m" + name: ${{ matrix.operating-system.name }} + steps: + - name: prepare + run: | + sudo apt update + curl -O https://raw.githubusercontent.com/monero-project/monero/${{ github.ref_name }}/contrib/gitian/gitian-build.py + chmod +x gitian-build.py + - name: setup + run: | + ./gitian-build.py --setup --docker github-actions ${{ github.ref_name }} + - name: build + run: | + ./gitian-build.py --docker --detach-sign --no-commit --build -j 3 -o ${{ matrix.operating-system.option }} github-actions ${{ github.ref_name }} + - name: post build + run: | + cd out/${{ github.ref_name }} + shasum -a256 * + echo \`\`\` >> $GITHUB_STEP_SUMMARY + shasum -a256 * >> $GITHUB_STEP_SUMMARY + echo \`\`\` >> $GITHUB_STEP_SUMMARY + - uses: actions/upload-artifact@v3.1.0 + with: + name: ${{ matrix.operating-system.name }} + path: | + out/${{ github.ref_name }}/* diff --git a/contrib/epee/src/portable_storage.cpp b/contrib/epee/src/portable_storage.cpp index b922cc9e3..cedc58e46 100644 --- a/contrib/epee/src/portable_storage.cpp +++ b/contrib/epee/src/portable_storage.cpp @@ -49,7 +49,7 @@ namespace serialization byte_stream ss; ss.reserve(initial_buffer_size); store_to_binary(ss); - target = epee::byte_slice{std::move(ss)}; + target = epee::byte_slice{std::move(ss), false}; return true; CATCH_ENTRY("portable_storage::store_to_binary", false); } diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp index c4d3856d4..085f4f9df 100644 --- a/src/wallet/api/wallet.cpp +++ b/src/wallet/api/wallet.cpp @@ -535,7 +535,7 @@ bool WalletImpl::createWatchOnly(const std::string &path, const std::string &pas view_wallet->generate(path, password, address, viewkey); // Export/Import outputs - auto outputs = m_wallet->export_outputs(); + auto outputs = m_wallet->export_outputs(true/*all*/); view_wallet->import_outputs(outputs); // Copy scanned blockchain @@ -553,7 +553,7 @@ bool WalletImpl::createWatchOnly(const std::string &path, const std::string &pas // Export/Import key images // We already know the spent status from the outputs we exported, thus no need to check them again - auto key_images = m_wallet->export_key_images(); + auto key_images = m_wallet->export_key_images(true/*all*/); uint64_t spent = 0; uint64_t unspent = 0; view_wallet->import_key_images(key_images.second, key_images.first, spent, unspent, false); @@ -1782,7 +1782,7 @@ uint64_t WalletImpl::estimateTransactionFee(const std::vector<std::pair<std::str m_wallet->use_fork_rules(HF_VERSION_CLSAG, 0), m_wallet->use_fork_rules(HF_VERSION_BULLETPROOF_PLUS, 0), m_wallet->use_fork_rules(HF_VERSION_VIEW_TAGS, 0), - m_wallet->get_base_fee(), + m_wallet->get_base_fee(priority), m_wallet->get_fee_quantization_mask()); } diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 17ff0e44b..91de4fe09 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -13326,9 +13326,7 @@ size_t wallet2::import_outputs(const std::tuple<uint64_t, uint64_t, std::vector< THROW_WALLET_EXCEPTION_IF(offset > m_transfers.size(), error::wallet_internal_error, "Imported outputs omit more outputs that we know of"); - THROW_WALLET_EXCEPTION_IF(offset >= num_outputs, error::wallet_internal_error, - "Offset is larger than total outputs"); - THROW_WALLET_EXCEPTION_IF(output_array.size() > num_outputs - offset, error::wallet_internal_error, + THROW_WALLET_EXCEPTION_IF(offset + output_array.size() > num_outputs, error::wallet_internal_error, "Offset is larger than total outputs"); const size_t original_size = m_transfers.size(); @@ -13408,9 +13406,7 @@ size_t wallet2::import_outputs(const std::tuple<uint64_t, uint64_t, std::vector< THROW_WALLET_EXCEPTION_IF(offset > m_transfers.size(), error::wallet_internal_error, "Imported outputs omit more outputs that we know of. Try using export_outputs all."); - THROW_WALLET_EXCEPTION_IF(offset >= num_outputs, error::wallet_internal_error, - "Offset is larger than total outputs"); - THROW_WALLET_EXCEPTION_IF(output_array.size() > num_outputs - offset, error::wallet_internal_error, + THROW_WALLET_EXCEPTION_IF(offset + output_array.size() > num_outputs, error::wallet_internal_error, "Offset is larger than total outputs"); const size_t original_size = m_transfers.size(); |