File tree Expand file tree Collapse file tree 7 files changed +103
-2
lines changed Expand file tree Collapse file tree 7 files changed +103
-2
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,38 @@ jobs:
164
164
- check-release
165
165
uses : ./.github/workflows/stacks-core-tests.yml
166
166
167
+ # # Checks to run on built binaries
168
+ # #
169
+ # # Runs when:
170
+ # # - it is a release run
171
+ # # or:
172
+ # # - it is not a release run
173
+ # # and any of:
174
+ # # - this workflow is called manually
175
+ # # - PR is opened
176
+ # # - PR added to merge queue
177
+ # # - commit to either (development, next, master) branch
178
+ stacks-core-build-tests :
179
+ if : |
180
+ needs.check-release.outputs.is_release == 'true' || (
181
+ github.event_name == 'workflow_dispatch' ||
182
+ github.event_name == 'pull_request' ||
183
+ github.event_name == 'merge_group' ||
184
+ (
185
+ contains('
186
+ refs/heads/master
187
+ refs/heads/develop
188
+ refs/heads/next
189
+ ', github.event.pull_request.head.ref) &&
190
+ github.event_name == 'push'
191
+ )
192
+ )
193
+ name : Stacks Core Build Tests
194
+ needs :
195
+ - rustfmt
196
+ - check-release
197
+ uses : ./.github/workflows/core-build-tests.yml
198
+
167
199
bitcoin-tests :
168
200
if : |
169
201
needs.check-release.outputs.is_release == 'true' || (
Original file line number Diff line number Diff line change
1
+ name : Core build tests
2
+
3
+ # Only run when:
4
+ # - PRs are (re)opened against develop branch
5
+ on :
6
+ workflow_call :
7
+
8
+ jobs :
9
+ check-consts :
10
+ name : Check the constants from stacks-inspect
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - name : Checkout the latest code
14
+ id : git_checkout
15
+ uses : actions/checkout@v3
16
+ - name : Define Rust Toolchain
17
+ id : define_rust_toolchain
18
+ run : echo "RUST_TOOLCHAIN=$(cat ./rust-toolchain)" >> $GITHUB_ENV
19
+ - name : Setup Rust Toolchain
20
+ id : setup_rust_toolchain
21
+ uses : actions-rust-lang/setup-rust-toolchain@v1
22
+ with :
23
+ toolchain : ${{ env.RUST_TOOLCHAIN }}
24
+ - name : Build the binaries
25
+ id : build
26
+ run : |
27
+ cargo build
28
+ - name : Dump constants JSON
29
+ id : consts-dump
30
+ run : cargo run --bin stacks-inspect -- dump-consts | tee out.json
31
+ - name : Set expected constants JSON
32
+ id : expects-json
33
+ run : diff out.json ./sample/expected_consts.json
Original file line number Diff line number Diff line change @@ -28,3 +28,4 @@ mutants = "0.0.3"
28
28
29
29
[features ]
30
30
slog_json = [" stacks_common/slog_json" , " clarity/slog_json" ]
31
+ testing = []
Original file line number Diff line number Diff line change
1
+ {
2
+ "chain_id_mainnet" : 1 ,
3
+ "chain_id_testnet" : 2147483648 ,
4
+ "microstacks_per_stacks" : 1000000 ,
5
+ "miner_reward_maturity" : 100 ,
6
+ "network_id_mainnet" : 385875968 ,
7
+ "network_id_testnet" : 4278190080 ,
8
+ "peer_version_mainnet_major" : 402653184 ,
9
+ "peer_version_testnet_major" : 4207599104 ,
10
+ "signer_slots_per_user" : 13 ,
11
+ "stacks_epoch_max" : 9223372036854775807
12
+ }
Original file line number Diff line number Diff line change @@ -36,7 +36,6 @@ use std::time::{SystemTime, UNIX_EPOCH};
36
36
use std:: { error, fmt, thread, time} ;
37
37
38
38
/// Given a relative path inside the Cargo workspace, return the absolute path
39
- #[ cfg( any( test, feature = "testing" ) ) ]
40
39
pub fn cargo_workspace < P > ( relative_path : P ) -> PathBuf
41
40
where
42
41
P : AsRef < Path > ,
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ serde_stacker = "0.1"
36
36
slog = { version = " 2.5.2" , features = [ " max_level_trace" ] }
37
37
slog-json = { version = " 2.3.0" , optional = true }
38
38
slog-term = " 2.6.0"
39
- stacks-common = { path = " ../stacks-common" , features = [ " testing " ] }
39
+ stacks-common = { path = " ../stacks-common" }
40
40
stackslib = { path = " ../stackslib" }
41
41
thiserror = { workspace = true }
42
42
tiny_http = { version = " 0.12" , optional = true }
@@ -49,6 +49,7 @@ rusqlite = { workspace = true, features = ["functions"] }
49
49
50
50
[dev-dependencies ]
51
51
clarity = { path = " ../clarity" , features = [" testing" ] }
52
+ stacks-common = { path = " ../stacks-common" , features = [" testing" ] }
52
53
num-traits = " 0.2.18"
53
54
54
55
[dependencies .serde_json ]
Original file line number Diff line number Diff line change @@ -1614,12 +1614,35 @@ check if the associated microblocks can be downloaded
1614
1614
process:: exit ( 0 ) ;
1615
1615
}
1616
1616
1617
+ if argv[ 1 ] == "dump-consts" {
1618
+ dump_consts ( ) ;
1619
+ }
1620
+
1617
1621
if argv. len ( ) < 4 {
1618
1622
eprintln ! ( "Usage: {} blockchain network working_dir" , argv[ 0 ] ) ;
1619
1623
process:: exit ( 1 ) ;
1620
1624
}
1621
1625
}
1622
1626
1627
+ #[ cfg_attr( test, mutants:: skip) ]
1628
+ pub fn dump_consts ( ) {
1629
+ use stacks_common:: consts;
1630
+ let json_out = json ! ( {
1631
+ "miner_reward_maturity" : consts:: MINER_REWARD_MATURITY ,
1632
+ "chain_id_mainnet" : consts:: CHAIN_ID_MAINNET ,
1633
+ "chain_id_testnet" : consts:: CHAIN_ID_TESTNET ,
1634
+ "signer_slots_per_user" : consts:: SIGNER_SLOTS_PER_USER ,
1635
+ "network_id_mainnet" : consts:: NETWORK_ID_MAINNET ,
1636
+ "network_id_testnet" : consts:: NETWORK_ID_TESTNET ,
1637
+ "microstacks_per_stacks" : consts:: MICROSTACKS_PER_STACKS ,
1638
+ "stacks_epoch_max" : consts:: STACKS_EPOCH_MAX ,
1639
+ "peer_version_mainnet_major" : consts:: PEER_VERSION_MAINNET_MAJOR ,
1640
+ "peer_version_testnet_major" : consts:: PEER_VERSION_TESTNET_MAJOR ,
1641
+ } ) ;
1642
+ println ! ( "{}" , serde_json:: to_string_pretty( & json_out) . unwrap( ) ) ;
1643
+ process:: exit ( 0 ) ;
1644
+ }
1645
+
1623
1646
#[ cfg_attr( test, mutants:: skip) ]
1624
1647
pub fn tip_mine ( ) {
1625
1648
let argv: Vec < String > = env:: args ( ) . collect ( ) ;
You can’t perform that action at this time.
0 commit comments