Skip to content

Commit

Permalink
Merge pull request #314 from semuxgo/master
Browse files Browse the repository at this point in the history
Fix macOS Big Sur launch issue
  • Loading branch information
semuxgo authored May 6, 2021
2 parents 81dc3ef + ccf5111 commit a62cb2e
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 15 deletions.
13 changes: 10 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,30 @@ matrix:
# License, formatter, and FindBugs check
- env: NAME="License, formatter, and FindBugs check"
os: linux
sudo: false
jdk: openjdk11
script:
- mvn license:check
- mvn formatter:validate
- mvn spotbugs:check

# Linux tests
- env: NAME="Linux tests"
- env: NAME="Linux tests (Java 11)"
os: linux
sudo: false
jdk: openjdk11
services:
- xvfb
script:
- mvn test

# macOS tests
- env: NAME="macOS tests (Java 15, Big Sur 11.1)"
os: osx
osx_image: xcode12.3
services:
- xvfb
script:
- mvn test '-Dtest=!org.semux.gui.**'

cache:
directories:
- .autoconf
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Change Log


## [v2.3.x](https://github.com/semuxproject/semux-core/tree/v2.3.0) (2021-05-06)

**Bug fixes:**
- Fixed the launching issue for macOS Big Sur

**Enhancements:**
- Migrated API specs to Open API 3.0


## [v2.2.x](https://github.com/semuxproject/semux-core/tree/v2.2.0) (2021-04-15)

This release brings in various bugfixes and enhancements to Semux Core.
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.semux</groupId>
<artifactId>semux-core</artifactId>
<version>2.2.1</version>
<version>2.3.0</version>
<packaging>jar</packaging>
<description>Semux is an experimental high-performance blockchain platform that powers decentralized application.</description>

Expand Down Expand Up @@ -632,7 +632,7 @@
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
<version>3.13.3</version>
<version>5.7.2</version>
</dependency>

<!-- Apache commons -->
Expand Down
6 changes: 1 addition & 5 deletions src/main/java/org/semux/Kernel.java
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,7 @@ protected void printSystemInfo() {
// memory
GlobalMemory m = hal.getMemory();
long mb = 1024L * 1024L;
logger.info("Memory: total = {} MB, available = {} MB, swap total = {} MB, swap available = {} MB",
m.getTotal() / mb,
m.getAvailable() / mb,
m.getSwapTotal() / mb,
(m.getSwapTotal() - m.getSwapUsed()) / mb);
logger.info("Memory: total = {} MB, available = {} MB", m.getTotal() / mb, m.getAvailable() / mb);

// disk
for (HWDiskStore disk : hal.getDiskStores()) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/semux/config/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class Constants {
/**
* Version of this client.
*/
public static final String CLIENT_VERSION = "2.2.1";
public static final String CLIENT_VERSION = "2.3.0";

/**
* Algorithm name for the 256-bit hash.
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/semux/crypto/Native.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ protected static void init() {
enabled = loadLibrary("/native/Linux-x86_64/libsemuxcrypto.so");
}
break;
case MACOS:
enabled = loadLibrary("/native/Darwin-x86_64/libsemuxcrypto.dylib");
break;
case WINDOWS:
enabled = loadLibrary("/native/Windows-x86_64/libsemuxcrypto.dll");
break;
Expand Down
Binary file not shown.
17 changes: 13 additions & 4 deletions src/test/java/org/semux/crypto/NativeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
*/
package org.semux.crypto;

import static org.junit.Assert.*;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;

import java.time.Duration;
Expand All @@ -17,7 +19,8 @@
import java.util.stream.Stream;

import org.apache.commons.lang3.RandomUtils;
import org.junit.Before;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.semux.util.Bytes;
import org.slf4j.Logger;
Expand All @@ -39,9 +42,15 @@ public class NativeTest {
private static final byte[] SIGNATURE = Hex
.decode("cc52ae5b72af210073756f801cf8ffa36cefe96c5010b2cf25d04dfc5b0495e4ee3e14774c4607a4475f2b449a3181c9bd2c6aed46ed283debfebe19589f550e");

@Before
public void check() {
@BeforeClass
public static void setup() {
assumeTrue(Native.isEnabled());
Native.disable();
}

@AfterClass
public static void teardown() {
Native.enable();
}

@Test(expected = CryptoException.class)
Expand Down

0 comments on commit a62cb2e

Please sign in to comment.