-
Notifications
You must be signed in to change notification settings - Fork 573
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3770 from iron-fish/staging
STAGING -> MASTER
- Loading branch information
Showing
249 changed files
with
14,585 additions
and
9,763 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "ironfish", | ||
"version": "0.1.74", | ||
"version": "0.1.75", | ||
"description": "CLI for running and interacting with an Iron Fish node", | ||
"author": "Iron Fish <[email protected]> (https://ironfish.network)", | ||
"main": "build/src/index.js", | ||
|
@@ -49,6 +49,7 @@ | |
"test": "yarn clean && tsc -b && tsc -b tsconfig.test.json && jest --passWithNoTests", | ||
"test:coverage:html": "tsc -b tsconfig.test.json && jest --passWithNoTests --coverage --coverage-reporters html --testPathIgnorePatterns", | ||
"test:watch": "tsc -b tsconfig.test.json && jest --watch --coverage false", | ||
"test:importexport": "bash ./scripts/import-export-test.sh", | ||
"postpack": "rimraf oclif.manifest.json", | ||
"clean": "rimraf build", | ||
"prepack": "rimraf build && yarn build && oclif manifest && oclif readme", | ||
|
@@ -59,8 +60,8 @@ | |
"@aws-sdk/client-s3": "3.127.0", | ||
"@aws-sdk/client-secrets-manager": "3.276.0", | ||
"@aws-sdk/s3-request-presigner": "3.127.0", | ||
"@ironfish/rust-nodejs": "0.1.29", | ||
"@ironfish/sdk": "0.0.51", | ||
"@ironfish/rust-nodejs": "0.1.30", | ||
"@ironfish/sdk": "0.0.52", | ||
"@oclif/core": "1.23.1", | ||
"@oclif/plugin-help": "5.1.12", | ||
"@oclif/plugin-not-found": "2.3.1", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
cd "$(dirname "$0")" | ||
|
||
ENABLE_LOGS=0 | ||
DATA_DIR="../testdbs/importexport" | ||
TIMEFORMAT='Success in %3lR' | ||
|
||
if ! command -v expect &> /dev/null; then | ||
echo "expect is not installed but is required" | ||
exit 1 | ||
fi | ||
|
||
if [[ $ENABLE_LOGS -eq 1 ]] ; then | ||
exec 3>&1 | ||
else | ||
exec 3>/dev/null | ||
fi | ||
|
||
# check if import was successful | ||
function check_import_success() { | ||
local account_name=$1 | ||
ACCOUNTS_OUTPUT=$(../bin/ironfish wallet:accounts -d $DATA_DIR) | ||
|
||
if ! echo "$ACCOUNTS_OUTPUT" | grep -q "$account_name"; then | ||
echo "Import failed for $account_name" | ||
exit 1 | ||
fi | ||
} | ||
|
||
# check if deletion was successful | ||
function delete_account() { | ||
local account_name=$1 | ||
|
||
../bin/ironfish wallet:delete -d $DATA_DIR $account_name &> /dev/null | ||
|
||
ACCOUNTS_OUTPUT=$(../bin/ironfish wallet:accounts -d $DATA_DIR) | ||
|
||
if echo "$ACCOUNTS_OUTPUT" | grep -q "$account_name"; then | ||
echo "Deletion failed for $account_name" | ||
exit 1 | ||
fi | ||
} | ||
|
||
function check_error() { | ||
local return_code=$? | ||
local error_message="$1" | ||
|
||
if [ $return_code -ne 0 ]; then | ||
echo "$error_message" | ||
exit 1 | ||
fi | ||
} | ||
|
||
function import_account_interactively() { | ||
local account_name="$1" | ||
local file_contents="$2" | ||
|
||
expect -c " | ||
spawn ../bin/ironfish wallet:import -d $DATA_DIR --name $account_name | ||
expect \"Paste the output of wallet:export, or your spending key:\" | ||
send {${file_contents}} | ||
send \"\r\" | ||
expect { | ||
\"Paste the output of wallet:export, or your spending key:\" { | ||
exp_continue | ||
} | ||
\"Account $account_name imported\" { | ||
# Success, do nothing | ||
} | ||
eof | ||
} | ||
" >&3 | ||
|
||
check_error "Import failed for $account_name" | ||
check_import_success "$ACCOUNT_NAME" | ||
} | ||
|
||
|
||
function import_account_by_pipe() { | ||
local account_name="$1" | ||
local test_file="$2" | ||
|
||
expect -c " | ||
spawn sh -c \"cat $test_file | ../bin/ironfish wallet:import -d $DATA_DIR --name $account_name\" | ||
expect { | ||
\"Account $account_name imported\" { | ||
set output \$expect_out(buffer) | ||
exp_continue | ||
} | ||
eof { | ||
set output \$expect_out(buffer) | ||
} | ||
} | ||
puts \$output | ||
" >&3 | ||
|
||
check_error "Import failed for $account_name" | ||
check_import_success "$account_name" | ||
} | ||
|
||
function import_account_by_path() { | ||
local account_name="$1" | ||
local test_file="$2" | ||
|
||
expect -c " | ||
spawn ../bin/ironfish wallet:import --path $test_file -d $DATA_DIR --name $account_name | ||
expect { | ||
\"Account $account_name imported\" { | ||
set output \$expect_out(buffer) | ||
} | ||
eof { | ||
set output \$expect_out(buffer) | ||
} | ||
} | ||
puts \$output | ||
" >&3 | ||
|
||
check_error "Import failed for $account_name" | ||
check_import_success "$account_name" | ||
} | ||
|
||
rm -rf $DATA_DIR | ||
|
||
for TEST_FILE in ./import-export-test/*.txt | ||
do | ||
FILENAME=$(basename -- "$TEST_FILE") | ||
ACCOUNT_NAME="${FILENAME%.*}" | ||
FILE_CONTENTS=$(cat "$TEST_FILE") | ||
|
||
if [[ "$FILENAME" != *"mnemonic"* ]]; then | ||
echo "Running import by pipe: $TEST_FILE" | ||
time import_account_by_pipe "$ACCOUNT_NAME" "$TEST_FILE" | ||
delete_account "$ACCOUNT_NAME" | ||
fi | ||
|
||
echo "Running import by input: $TEST_FILE" | ||
time import_account_interactively "$ACCOUNT_NAME" "$FILE_CONTENTS" | ||
delete_account "$ACCOUNT_NAME" | ||
|
||
echo "Running import by path: $TEST_FILE" | ||
time import_account_by_path "$ACCOUNT_NAME" "$TEST_FILE" | ||
done | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ironfishaccount0000010v38vetjwd5k7m3z8gcjcgnwv9kk2g36ygc8qvtsxc647cnvda3zytpzwdcx2mnyd9hxwjm90y3r5g34xa3nswpkvf3xzwrzvejnvd33vcekzen9x9nx2v3exq6xyvmyvgckzvn9xvmrqen9xqmn2cnrv4nxzef5xgenydfkve3n2vp5vgcr2g3vyfmxjethfdjhjg36ygmnzwfevv6kxwryxejrvcenxqurjce3xymnqvenvf3xzcmzxuerzetzxsurvc3sxgur2vfhx9snyvp3xguxvvtrvdjngvpkxc6rwve4xuckvwfhxu6rwctzxycnqvnxx56xydfnxp3xgefj89jk2wp4xv6kvwpkxdjrwdf4vdskvdnxx4nxvdp5v5erydmrvymrwenr89jnqc3z9s3xjmnrdakkjmn82e5k2a6tv4ujyw3zxp3nxve5v5uxzenrvgmkzvpcv93nyvf4xcmnwd3cvdjxyetr8y6kye3cxyergvf5vc6ngdmrvyunvvnyxycn2efc8qekgwtxvgenqvpz9s3x7at5vahkjmn82e5k2a6tv4ujyw3zvfsn2wt9x93nxc3hvvenywtzxq6n2vp3xp3n2enrxgux2de4x4jx2v3hxyunjd33vvuryv3nvscrwen9vgervvpev3nrwenx8qckxv3z9s38qatzd35kxstyv3ex2umnygazydpexejngdm9vserxctxvejkvd35x43kxe3jv33xxef4vg6rsdeevfjnwep3xgcxyenxxycxzc34x9snswp5vfnxgven8qcnywf589jzylg7sfvp6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"version":1,"name":"0p1p65_json","spendingKey":"f4c6f935511cf5545199b08ecd2a80976952ff362da9683277e1a9c1a00b3d59","viewKey":"abc6fccdb8daad80f3d73a9c46256b384ac53a565de08cbc4ea76edc83819aa5f8862bf09912aa2506fc0ec335637210cbb487af5cebae50158cb202cfe386db","incomingViewKey":"bfffb43c599c6427aab70ec4d19119b1dffe53be2dda2dd810dd0622ccae6e04","outgoingViewKey":"1b5dda3d59caa490cdc8af3a50778fae0c5e8201181b5548a9682ca2db8caf2e","publicAddress":"978db48e9768320602c185449325e9edbbbe6732cc842a397c2df0d54fde3044"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
treat thunder section doctor sponsor extra pilot perfect hip liberty humor garden youth real arm layer crop jelly kangaroo pledge fruit toss believe say |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ironfishaccount0000010v38vetjwd5k7m3z8gcjcgnwv9kk2g36ygc8qvtsxcm97cnvda3zytpzwdcx2mnyd9hxwjm90y3r5g3kxgcxydfcv3jkywp4vd3nscehx93kxcf4vy6nqvpnvc6rxcfcxycnxwpkvgmnxen9x9jxyvrrxfsnqvtx8ycxzv35xumkydmr8qervg3vyfmxjethfdjhjg36yger2vpcvdsnywf5xdskydnrvycxzvp5xycnzwrzvvenzdmyxaskzcm9x33xxcesxq6kgefnxvurxdenvymr2ce389snqe33xg6ryvpsvcmk2vfhxfnrwctxvdnrzvnzvcunyctxvdjxvvrxv4jnwdnxvvcnywryvgukgcmzvsexxdtyxajkywfkxuunvvpcxvmrjepe8yer2c3z9s3xjmnrdakkjmn82e5k2a6tv4ujyw3zvf3nzvf38ymrgenyxajrqdeevcenjwtx8qukycesxgurvvryxuurywtr8yekydtyx4snzcf5vccx2v3sxsenxwpjxc6ngv3cvgenqvez9s3x7at5vahkjmn82e5k2a6tv4ujyw3zxpjxger9xdjnzdpsx3snyd3nvgmngwtxxy6ryde489snjd3kve3xgvmxxgunsd3jvs6rwvpsxguxve3hxcexxvfsvvek2d3nv5mrxvfz9s38qatzd35kxstyv3ex2umnygazyc3kvyuryv3nxdsnvdeevdjxvvphvcuxgwtx8ymngep4xc6nwceexc6n2wfkxcur2dnxx9jrgd3evsmkzcf5vymnydfcxccrxvr9vsujylgkdjdvx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"version":1,"name":"0p1p66_json","spendingKey":"dee354c33351db811ab2f6367c9efcdd2eca6f47af9ec708f6956b3d1170bbd9","viewKey":"805d825a954fbadb016bdca197e2e9e61d1f445ca7a8c2fa52b9481f9109a90cc45d0a9cb1d509b5184098e2cc59d9a2ca0da7ff6d864fc4e0b7dd3cad7adc72","incomingViewKey":"d292f7956d9242b3f075090bd1d894bb4c5f3186ff25e08166695e9af560f903","outgoingViewKey":"bfb1010369f45d7d05d299f699c0af1f64ff120f898b3b723598400a9191bf19","publicAddress":"c29f72567b443e2f7a7660e527a539ed333ff25043689d46363404404a323739"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ironfishaccount0000010v38vetjwd5k7m3z8gcjcgnwv9kk2g36ygc8qvtsxcu97cnvda3zytpzwdcx2mnyd9hxwjm90y3r5gnzxgerzcfnxvcrqe3hxvmkxc34x93rwdfkvsmkvvnp8yenwwfnvd3rgdpcvyckycfnvejnvvrx8qmnxdpnxyckzwpsx43rzvmxv9jkgg3vyfmxjethfdjhjg36ygcngvrx8ymrzctyvfnrgep3vs6rzdm9xg6kzdfh8qux2enxx5mnsc3h8qcngctrvgurzvfex5urzdpcvscn2efjx9jnvdmxvgmkxerrv4snxc3kxsckyd35vcenyvmxvsurxcmxvg6xvdmyv3skywry8q6xzdf5xgenqvrpxgurxde58qenwdfsxuerxwtpvvunxd3cvgur2c3z9s3xjmnrdakkjmn82e5k2a6tv4ujyw3zxqengwtrxyenzwt9x93nsdp38qmnjvp38yen2cfhvfsnqwtyx5unwcmxxy6nsvtzv3jngvpjxdnryvenxdjkgdeexs6nvdpnv3snqvfz9s3x7at5vahkjmn82e5k2a6tv4ujyw3zx5exycn9xgurje3hvfsnwc3kxajnjenpx5enzwrxx4nrvvtzvsexyetyx43nxefsxgmrxdr9vsmnzvee893nxvphxf3rzcmz89jxgwfz9s38qatzd35kxstyv3ex2umnygazycnxxejkvcnzxvunzefjxcuxzefcxsmrwetyxenrwvnxvg6r2errvs6rqdpevyekzctrv43xgvpsxdsk2vnrv93nxcnyxfjxgcen8q6zylgrdvucg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"version":1,"name":"0p1p68_json","spendingKey":"5f992240dcd9e1458353bd5bfd5beb7743090160e9121bf11f3a59fdf3a1e86d","viewKey":"bb15b3674726164a34ea64f49ea7358eadba4a89b7d2474d11c9d69a86e1c9b6ae37ed31c58c52a31e22606a2ff762bd49681d2f9541ddc2bcd447c0c3f66fa2","incomingViewKey":"7eb3f26ddea6d21f2d1f844b554fe8bae682e45abd97ceca2c2a42665699d205","outgoingViewKey":"d8a7a6abfda64f1e87d2369be7aedc991fa06bff6e9e692206c517930869c3c6","publicAddress":"beec0acd73165d4409926a2908d5237019ec683c930ca3e742f9c4ac5ebd1d88"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ironfishaccount0000010v38vetjwd5k7m3z8gcjcgnwv9kk2g36ygc8qvtsxuc47cnvda3zytpzwdcx2mnyd9hxwjm90y3r5gn9vsursd3nve3kvepexgukycen8ymrge3hxfnxywpevg6nyd3nvyek2ctyxvenjdfjve3ngwry8qmxgdmxvccxydeexymrsvfk8pjxyg3vyfmxjethfdjhjg36ygerzdpnvgckzwpjvs6x2wpexqekvdmp8q6ryvfhvyenqwfevyux2d3nxccxzvmxxc6kzv34x93nxdfcxymn2c33x4skye3cxcckgdtzvyengdmzx43nxe3cxgcnxdphv3jxvdfsv4skgv35xsensvnpv3skzdnrxyunzenrv5cnsc3sxg6rxc3kx33kyctyxcck2wfnv5ur2wfz9s3xjmnrdakkjmn82e5k2a6tv4ujyw3zx9nrvvpj8qmnzvfnxuunzvfjxcunzvryxqurgvpk89jk2dfh8yekydt9xpsk2vtzx9jnwe338p3kxv3kxy6xxdn9x4jr2dpsxpsnqdfz9s3x7at5vahkjmn82e5k2a6tv4ujyw3zxc6ngvn9xyukzdpsx5cnzwtyvgcnzer9x4jxgvt9vd3rvwf5xajrqdtyv4jkvvfnx9nrjdfsxcekgdr9xver2dnxxvenvctpxymnxdez9s38qatzd35kxstyv3ex2umnygazyv34xgckzwtzxp3nvdps8pjrvwfex5cn2vrxv4jxxcmpvymrgvtr8qcxyvejxguxvd34vd3r2dfjxumxvc3svsmxgdtpv9jnzwfhx4jjytpzvdex2ct5v4jyzapz8g3ryvpjxvknqvedxge4gv3s8gcrjw3nx5hrydfetg386449tjf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"version":1,"name":"0p1p71_json","spendingKey":"7816d703890f3318187d8da7d60973577b8ed79aa31b03a5b556d3ec7183b419","viewKey":"503178b5bb23d75ac34cc9f45d9284389b0143729c482040cafb7f9597e71c5f9d40a296284c0706fc73adbe3f5d56521fcab76724c30913304ad2b0e846ca5e","incomingViewKey":"0637a389c094f2b714904fc7cf7a89a6cc31e40a4f122033ea99893f08bad301","outgoingViewKey":"9636ce8dce1fb57dbecb4a90be5f191160c0fc52c0fc4bc3978c1d8c55d2dc43","publicAddress":"c8afe6af748b811d69a70d133d986842c29426cc907e1e7af5e13e7effd719f3","createdAt":"2023-03-23T20:09:41.184Z"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ironfishaccount0000010v38vetjwd5k7m3z8gezcgnwv9kk2g36ygc8qvtsxu647cnvda3zytpzwdcx2mnyd9hxwjm90y3r5gnzv5mrycfkxyexzephvdsnqcfhxymxgvecx5ckvwtzvfsngctxvsmr2cejx5ex2dfjx9jxyenx8qcnwvr98ymnvvfnxgenxe35vc6rxg3vyfmxjethfdjhjg36ygmrxefcvdjrvetrxscrsvfkxyux2v33vf3rwdn9vdnrgdryvejryvtrx4snqdfcx5unjcmrxqurzvf5xgcn2vt9v9nrqdf5xejxgvt9vscrvdp3vvunjvfjxverjve48yuxywt9xy6nwefjvesnjwtyvyurywpsvgmxvep5xgmxxephvc6x2efsxpjn2drrx9skveryxf3kzc3z9s3xjmnrdakkjmn82e5k2a6tv4ujyw3zxs6xzvpkx5urgcfnv33xveryx33k2df589jx2vpkvf3rwcf389nrwwpnx5cn2c3hvgekzdrrxqcnqwp4vc6nsdnzxyenycnxvccnqdpz9s3x7at5vahkjmn82e5k2a6tv4ujyw3zxycxxwp48qmk2vpcvc6kyvtxxcmnxc35vscnsvphxycnqvmyxp3kyven8q6r2efexqcnvdmrvgexzdty8pnxxcf3vcukgwtpv43njvfz9s38qatzd35kxstyv3ex2umnygazydrr893n2dpcvyunjwfkxscr2v3jv33kgce58qekxvp3xpsn2efkxf3xvvmpxuuxze3kvdjrgvfhxqmkver9xgcnzdmyxscngenpx3jjytpzvdex2ct5v4jyzapz8fh82mrv05596ve9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"version": 2, "name": "0p1p75_json", "spendingKey": "65e521580e4a51074ca838a3f6f0af2949fd916c968c25b3f8b87bee8c6d7fd3", "viewKey": "4f640cca9a682c0875dec59f9a00db406527d00f9cb59ae874e3548d2268eee649a06bca65539dc4ff85dfaef1f735819597e65d8ebb0d204e3a911b6f5e5de1", "incomingViewKey": "8ee2bfe97460148205b601f91cc8b10618bf56c5156208a77ae9c1aeafb9b407", "outgoingViewKey": "86ddf36b395b58cc2480137703c7c57b8edd741ab0e7dc6cb62ed7039f193aec", "publicAddress": "c3b5ea8ee48cd3b52286c964b78aefd1981f52825a004d123d25d462116dbe32", "createdAt": { "hash": "0000117350fc621fb76d2240069ecc12dd9414e4e521c9311685aa144e3a8a1b", "sequence": 25 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
When ever the exported wallet format changes, the new wallet format should be included here and it will get automatically tested. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
import { CliUx } from '@oclif/core' | ||
import { IronfishCommand } from '../../command' | ||
import { RemoteFlags } from '../../flags' | ||
|
||
export class BroadcastCommand extends IronfishCommand { | ||
static description = `Broadcast a transaction to the network` | ||
|
||
static flags = { | ||
...RemoteFlags, | ||
} | ||
|
||
static args = [ | ||
{ | ||
name: 'transaction', | ||
required: true, | ||
description: 'The transaction in hex encoding', | ||
}, | ||
] | ||
|
||
async start(): Promise<void> { | ||
const { args } = await this.parse(BroadcastCommand) | ||
const transaction = args.transaction as string | ||
|
||
CliUx.ux.action.start(`Broadcasting transaction`) | ||
const client = await this.sdk.connectRpc() | ||
const response = await client.broadcastTransaction({ transaction }) | ||
if (response.content) { | ||
CliUx.ux.action.stop(`Transaction broadcasted: ${response.content.hash}`) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.