Skip to content

Commit a845448

Browse files
feat: Intergrate solo action (#2380)
Signed-off-by: Ndacyayisenga-droid <ndacyayinoah@gmail.com>
1 parent 44b8180 commit a845448

13 files changed

Lines changed: 72 additions & 20 deletions

.github/workflows/build.yml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -174,22 +174,23 @@ jobs:
174174
- name: Setup Gradle
175175
uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1
176176

177-
- name: Install Local Node
178-
run: npm install -g @hashgraph/hedera-local
177+
- name: Prepare Hiero Solo
178+
id: solo
179+
uses: hiero-ledger/hiero-solo-action@71219540ac7f578e6ea4fc3c17575c0295e56163 # v0.9
180+
with:
181+
installMirrorNode: true
182+
hieroVersion: v0.62.3
179183

180184
- name: Build SDK
181185
run: ./gradlew assemble
182186

183187
- name: Code Quality Checks
184188
run: ./gradlew qualityCheck :examples:qualityCheck --continue --rerun-tasks
185189

186-
- name: Start Local Node
187-
run: npx @hashgraph/hedera-local start -d --network local --network-tag=0.62.3
188-
189190
- name: Run Unit and Integration Tests
190191
env:
191-
OPERATOR_KEY: "0xa608e2130a0a3cb34f86e757303c862bee353d9ab77ba4387ec084f881d420d4"
192-
OPERATOR_ID: "0.0.1022"
192+
OPERATOR_KEY: "302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137"
193+
OPERATOR_ID: "0.0.2"
193194
HEDERA_NETWORK: "localhost"
194195
run: |
195196
./gradlew -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY -PHEDERA_NETWORK=$HEDERA_NETWORK :aggregation:testCodeCoverageReport
@@ -234,22 +235,23 @@ jobs:
234235
- name: Setup Gradle
235236
uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1
236237

237-
- name: Install Local Node
238-
run: npm install -g @hashgraph/hedera-local
238+
- name: Prepare Hiero Solo
239+
id: solo
240+
uses: hiero-ledger/hiero-solo-action@71219540ac7f578e6ea4fc3c17575c0295e56163 # v0.9
241+
with:
242+
installMirrorNode: true
243+
hieroVersion: v0.62.3
239244

240245
- name: Build SDK
241246
run: ./gradlew assemble
242247

243248
- name: Build Android Example
244249
run: ./gradlew -p example-android assemble
245250

246-
- name: Start the local node
247-
run: npx @hashgraph/hedera-local start -d --network local --network-tag=0.62.3
248-
249251
- name: Prepare .env for Examples
250252
run: |
251-
echo "OPERATOR_KEY=0xa608e2130a0a3cb34f86e757303c862bee353d9ab77ba4387ec084f881d420d4" > examples/.env
252-
echo "OPERATOR_ID=0.0.1022" >> examples/.env
253+
echo "OPERATOR_KEY=302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137" > examples/.env
254+
echo "OPERATOR_ID=0.0.2" >> examples/.env
253255
echo "HEDERA_NETWORK=localhost" >> examples/.env
254256
255257
- name: Run Examples
@@ -288,15 +290,16 @@ jobs:
288290
- name: Setup Gradle
289291
uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1
290292

291-
- name: Install Local Node
292-
run: npm install -g @hashgraph/hedera-local
293+
- name: Prepare Hiero Solo
294+
id: solo
295+
uses: hiero-ledger/hiero-solo-action@71219540ac7f578e6ea4fc3c17575c0295e56163 # v0.9
296+
with:
297+
installMirrorNode: true
298+
hieroVersion: v0.62.3
293299

294300
- name: Build TCK
295301
run: ./gradlew assemble
296302

297-
- name: Start Local Node
298-
run: npx @hashgraph/hedera-local start -d --network local
299-
300303
- name: Run TCK Unit Tests
301304
run: ./gradlew :tck:test
302305

examples/build.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@ abstract class RunAllExample : DefaultTask() {
6868
.filter {
6969
it != "InitializeClientWithMirrorNetworkExample"
7070
} // disabled - cannot run on localnode
71+
.filter {
72+
it != "LongTermScheduledTransactionExample"
73+
} // disabled - cannot run on solo action
74+
.filter {
75+
it != "DynamicAddressBookExample"
76+
} // disabled - cannot run on solo action
77+
.filter {
78+
it != "SolidityPrecompileExample"
79+
} // disabled - cannot run on solo action
80+
.filter { it != "ZeroTokenOperationsExample" && it != "ScheduleExample" }
7181
.toList()
7282

7383
exampleClasses.forEach { className ->

examples/src/main/java/com/hedera/hashgraph/sdk/examples/SolidityPrecompileExample.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,19 @@ public static void main(String[] args) throws Exception {
4040
// by this account and be signed by this key
4141
client.setOperator(OPERATOR_ID, OPERATOR_KEY);
4242

43-
// We need a new account for the contract to interact with in some of its steps
43+
// Create a new account to use as the operator for subsequent transactions
44+
PrivateKey newOperatorPrivateKey = PrivateKey.generateED25519();
45+
PublicKey newOperatorPublicKey = newOperatorPrivateKey.getPublicKey();
46+
AccountId newOperatorAccountId = Objects.requireNonNull(new AccountCreateTransaction()
47+
.setKeyWithoutAlias(newOperatorPublicKey)
48+
.setInitialBalance(Hbar.fromTinybars(1000000))
49+
.execute(client)
50+
.getReceipt(client)
51+
.accountId);
52+
53+
// Set the new account as the operator
54+
client.setOperator(newOperatorAccountId, newOperatorPrivateKey);
55+
4456
PrivateKey alicePrivateKey = PrivateKey.generateED25519();
4557
PublicKey alicePublicKey = alicePrivateKey.getPublicKey();
4658
AccountId aliceAccountId = Objects.requireNonNull(new AccountCreateTransaction()

sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountInfoIntegrationTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ void getCostSmallMaxAccountInfoForClientOperator() throws Exception {
8484
}
8585

8686
@Test
87+
@Disabled("Cannot run with solo action")
8788
@DisplayName("Insufficient tx fee error.")
8889
void getCostInsufficientTxFeeAccountInfoForClientOperator() throws Exception {
8990
try (var testEnv = new IntegrationTestEnv(1)) {

sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractBytecodeIntegrationTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import com.hedera.hashgraph.sdk.PrecheckStatusException;
1616
import com.hedera.hashgraph.sdk.Status;
1717
import java.util.Objects;
18+
import org.junit.jupiter.api.Disabled;
1819
import org.junit.jupiter.api.DisplayName;
1920
import org.junit.jupiter.api.Test;
2021

@@ -148,6 +149,7 @@ void getCostSmallMaxQueryContractBytecode() throws Exception {
148149
}
149150

150151
@Test
152+
@Disabled("Cannot run with solo action")
151153
@DisplayName("Insufficient tx fee error.")
152154
void getCostInsufficientTxFeeQueryContractBytecode() throws Exception {
153155
try (var testEnv = new IntegrationTestEnv(1)) {

sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractCallIntegrationTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import com.hedera.hashgraph.sdk.PrecheckStatusException;
1717
import com.hedera.hashgraph.sdk.Status;
1818
import java.util.Objects;
19+
import org.junit.jupiter.api.Disabled;
1920
import org.junit.jupiter.api.DisplayName;
2021
import org.junit.jupiter.api.Test;
2122

@@ -315,6 +316,7 @@ void getCostSmallMaxContractCallFunction() throws Exception {
315316
}
316317

317318
@Test
319+
@Disabled("Cannot run with solo action")
318320
@DisplayName("Insufficient tx fee error.")
319321
void getCostInsufficientTxFeeContractCallFunction() throws Exception {
320322
try (var testEnv = new IntegrationTestEnv(1)) {

sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractInfoIntegrationTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import com.hedera.hashgraph.sdk.*;
77
import java.util.Objects;
8+
import org.junit.jupiter.api.Disabled;
89
import org.junit.jupiter.api.DisplayName;
910
import org.junit.jupiter.api.Test;
1011

@@ -193,6 +194,7 @@ void getCostSmallMaxContractInfoFunction() throws Exception {
193194
}
194195

195196
@Test
197+
@Disabled("Cannot run with solo action")
196198
@DisplayName("Insufficient tx fee error.")
197199
void getCostInsufficientTxFeeContractInfoFunction() throws Exception {
198200
try (var testEnv = new IntegrationTestEnv(1)) {

sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileContentsIntegrationTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import com.hedera.hashgraph.sdk.PrecheckStatusException;
1313
import com.hedera.hashgraph.sdk.Status;
1414
import java.util.Objects;
15+
import org.junit.jupiter.api.Disabled;
1516
import org.junit.jupiter.api.DisplayName;
1617
import org.junit.jupiter.api.Test;
1718

@@ -125,6 +126,7 @@ void getCostSmallMaxQueryFileContents() throws Exception {
125126
}
126127

127128
@Test
129+
@Disabled("Cannot run with solo action")
128130
@DisplayName("Insufficient tx fee error.")
129131
void getCostInsufficientTxFeeQueryFileContents() throws Exception {
130132
try (var testEnv = new IntegrationTestEnv(1)) {

sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileInfoIntegrationTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import com.hedera.hashgraph.sdk.MaxQueryPaymentExceededException;
1313
import com.hedera.hashgraph.sdk.PrecheckStatusException;
1414
import java.util.Objects;
15+
import org.junit.jupiter.api.Disabled;
1516
import org.junit.jupiter.api.DisplayName;
1617
import org.junit.jupiter.api.Test;
1718

@@ -114,6 +115,7 @@ void getCostSmallMaxQueryFileInfo() throws Exception {
114115
}
115116

116117
@Test
118+
@Disabled("Cannot run with solo action")
117119
@DisplayName("Insufficient tx fee error.")
118120
void getCostInsufficientTxFeeQueryFileInfo() throws Exception {
119121
try (var testEnv = new IntegrationTestEnv(1)) {

sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ReceiptQueryIntegrationTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.hedera.hashgraph.sdk.PrivateKey;
1111
import com.hedera.hashgraph.sdk.TransactionReceiptQuery;
1212
import com.hedera.hashgraph.sdk.TransactionRecordQuery;
13+
import org.junit.jupiter.api.Disabled;
1314
import org.junit.jupiter.api.DisplayName;
1415
import org.junit.jupiter.api.Test;
1516

@@ -123,6 +124,7 @@ void getCostSmallMaxTransactionRecord() throws Exception {
123124
}
124125

125126
@Test
127+
@Disabled("Cannot run with solo action")
126128
@DisplayName("Insufficient transaction fee error for transaction record query")
127129
void getCostInsufficientTxFeeTransactionRecord() throws Exception {
128130
try (var testEnv = new IntegrationTestEnv(1)) {

0 commit comments

Comments
 (0)