tari-project / tari

The Tari protocol
https://tari.com
BSD 3-Clause "New" or "Revised" License
354 stars 219 forks source link

feat: exit logic for pre-mine spend #6615

Closed hansieodendaal closed 1 month ago

hansieodendaal commented 1 month ago

Description

Add exit logic for immediate pre-mine spend. In other cases, the wallet should be started so that the transaction(s) can be broadcast.

Motivation and Context

With immediate pre-mne spend, the blockchain does not exist yet and the transaction will be rejected if the wallet is started.

How Has This Been Tested?

System-level testing completed with base nodes and network available. The wallet did not connect to the network and could not broadcast partially completed transaction to a base node.

Step 3

PS H:\node_01> .\minotari_console_wallet.exe --base-path . --network esmeralda --config $pwd"\config\config.toml" --log-config $pwd"\config\log4rs_console_wallet.yml" pre-mine-spend-encumber-aggregate-utxo --session-id 8rJDGzkJv598xVJ3 --input-file-names=step_2_for_leader_from_bob.json --pre-mine-file-path "C:\Users\<user>\Documents\tari_pre_mine\create"
Initializing logging according to "H:\\node_01\\config\\log4rs_console_wallet.yml"
Minotari Console Wallet running... (Command mode started)
==============
Command Runner
==============

1. PreMineSpendEncumberAggregateUtxo(PreMineSpendEncumberAggregateUtxoArgs { session_id: "8rJDGzkJv598xVJ3", input_file_names: ["step_2_for_leader_from_bob.json"], pre_mine_file_path: Some("C:\\Users\\<user>\\Documents\\tari_pre_mine\\create") })

  Processed 1 of 6 transactions
  Processed 2 of 6 transactions
  Processed 3 of 6 transactions
  Processed 4 of 6 transactions
  Processed 5 of 6 transactions
  Processed 6 of 6 transactions

Concluded step 3 'pre-mine-spend-encumber-aggregate-utxo'
Send 'step_3_for_parties.json' to parties for step 4

Minotari Console Wallet running... (Command mode completed)

Shutting down wallet... Done.

Step 5

PS H:\node_01> .\minotari_console_wallet.exe --base-path . --network esmeralda --config $pwd"\config\config.toml" --log-config $pwd"\config\log4rs_console_wallet.yml" pre-mine-spend-aggregate-transaction --session-id 8rJDGzkJv598xVJ3 --input-file-names=step_4_for_leader_from_bob.json
Initializing logging according to "H:\\node_01\\config\\log4rs_console_wallet.yml"
Minotari Console Wallet running... (Command mode started)
==============
Command Runner
==============

1. PreMineSpendAggregateTransaction(PreMineSpendAggregateTransactionArgs { session_id: "8rJDGzkJv598xVJ3", input_file_names: ["step_4_for_leader_from_bob.json"] })

  Processed 1 of 6

  Processed 2 of 6

  Processed 3 of 6

  Processed 4 of 6

  Processed 5 of 6

  Processed 6 of 6

Genesis block immediate pre-mine spend information: 'esmeralda_pre_mine_addition.json' in 'C:\Users\<user>\Documents\tari_pre_mine\spend\8rJDGzkJv598xVJ3'
Concluded step 5 'pre-mine-spend-aggregate-transaction'

Minotari Console Wallet running... (Command mode completed)

Shutting down wallet... Done.

What process can a PR reviewer use to test or verify this change?

Code review.

Breaking Changes

github-actions[bot] commented 1 month ago

Test Results (CI)

    3 files    129 suites   38m 56s :stopwatch: 1 326 tests 1 325 :white_check_mark: 0 :zzz: 1 :x: 3 976 runs  3 975 :white_check_mark: 0 :zzz: 1 :x:

For more details on these failures, see this check.

Results for commit efe2ba26.

:recycle: This comment has been updated with latest results.

github-actions[bot] commented 1 month ago

Test Results (Integration tests)

 2 files  11 suites   23m 51s :stopwatch: 36 tests 35 :white_check_mark: 0 :zzz: 1 :x: 37 runs  36 :white_check_mark: 0 :zzz: 1 :x:

For more details on these failures, see this check.

Results for commit efe2ba26.

:recycle: This comment has been updated with latest results.