Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove is confirmed check #3633

Merged
merged 2 commits into from
Mar 10, 2023
Merged

Remove is confirmed check #3633

merged 2 commits into from
Mar 10, 2023

Conversation

ygao76
Copy link
Contributor

@ygao76 ygao76 commented Mar 10, 2023

Summary

The is confirmed check is done in getUnspentNotes
This is redundant and incorrect check.

Testing Plan

local cli
Before

yarn start wallet:send --rawTransaction --offline --datadir=~/.ironfish-1 -t 0e0e42628ae521b5971b6a6c0384e41a623e6332249f86ef080184440d5e0840 -a 1 -o 0.00000001 -v

yarn run v1.22.19
$ yarn build && yarn start:js wallet:send --rawTransaction --offline '--datadir=~/.ironfish-1' -t 0e0e42628ae521b5971b6a6c0384e41a623e6332249f86ef080184440d5e0840 -a 1 -o 0.00000001 -v
$ tsc -b
$ cross-env OCLIF_TS_NODE=0 IRONFISH_DEBUG=1 node --expose-gc --inspect=:0 --inspect-publish-uid=http --enable-source-maps bin/run wallet:send --rawTransaction --offline '--datadir=~/.ironfish-1' -t 0e0e42628ae521b5971b6a6c0384e41a623e6332249f86ef080184440d5e0840 -a 1 -o 0.00000001 -v
Connecting to /Users/yajun/.ironfish-1/ironfish.ipc
Insufficient funds: Needed $IRON 1.00000001 but have 0.00000000 available to spend. Please fund your account and/or wait for any pending transactions to be confirmed.'
ValidationError: Insufficient funds: Needed $IRON 1.00000001 but have 0.00000000 available to spend. Please fund your account and/or wait for any pending transactions to be confirmed.'
    at <anonymous> (/Users/yajun/ironfish/ironfish/ironfish/src/rpc/routes/wallet/createTransaction.ts:188:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Router.route (/Users/yajun/ironfish/ironfish/ironfish/src/rpc/routes/router.ts:101:7)
    at RpcIpcAdapter.onClientData (/Users/yajun/ironfish/ironfish/ironfish/src/rpc/adapters/socketAdapter/socketAdapter.ts:246:9)
✨  Done in 1.28s.

After

yarn start wallet:send --rawTransaction --offline --datadir=~/.ironfish-1 -t 0e0e42628ae521b5971b6a6c0384e41a623e6332249f86ef080184440d5e0840 -a 1 -o 0.00000001 -v

yarn run v1.22.19
$ yarn build && yarn start:js wallet:send --rawTransaction --offline '--datadir=~/.ironfish-1' -t 0e0e42628ae521b5971b6a6c0384e41a623e6332249f86ef080184440d5e0840 -a 1 -o 0.00000001 -v
$ tsc -b
$ cross-env OCLIF_TS_NODE=0 IRONFISH_DEBUG=1 node --expose-gc --inspect=:0 --inspect-publish-uid=http --enable-source-maps bin/run wallet:send --rawTransaction --offline '--datadir=~/.ironfish-1' -t 0e0e42628ae521b5971b6a6c0384e41a623e6332249f86ef080184440d5e0840 -a 1 -o 0.00000001 -v
Connecting to /Users/yajun/.ironfish-1/ironfish.ipc
Raw Transaction
01000000000000000100000000000000a8053f85f8103e8cb96c6c0c7dae45826d9bab350a6753be4534bc191b760f166dd7c86706f5817aa718cd1cfad03233bcd64a7789fd9422d3b17af6823a7e6ac600800eb4e0eb0e00334182218061b646f6f4172aec2a92cb7ae7f4ca910639b51b524406129b440147656e6573697320426c6f636b00000000000000000000000000000000000000f9f37b7fca2aa5440d429dba7a00aaa2210a0da8090f8606c56a9baf86bd0ac7030000000000000020c971e61a65df4c334ea1eaa2dbec11be37ae99c818e3b42db2c9800e837eda3920000000000000000020677f865633af7b434a6d3ff3868f05b73a3d99596c9bbc327b464c73879cdd560120333b8f73a38aeed8ae2a4ec8d4135d9dd17ef999263e0a9b3d8be19dfbc8453e0020e5913f4e817be9ffb1ff4b010d5e3f7e8dc6ed8e1ebed9d12348a67f39ee3304002026da64f9d8fe689db938c1d540a19c812c88c4089692d3e93da6c110d66f8a6000203d0cf248407ff2b678cf8c5aac0e477556a687116683e4e94f26c0e23921e95d0020879b92fce4e56ef0ce31ee8b9ff127abbc9234e79c6a4730a60b25b1228682090020044fb2205ca6e5f3d2c00be06df8dee6f30efa06df63ddca9dc905282b72f35f002076e08cb05c13284f5fdf388711efda84499ac12374b19c37b103dd0c4ed90e1c00204ca54320f97e8cac51e5b9920a760f3a4e86c22d19685bd12fc7b69a9261646300207db3e92e1ec464f703088a69d23d6f815240d60f20deb7cbe761d4442c18ff690020d7684ccff15912c47b190dd38e82e37bbf720a94d6812e3f2435c0d8cfb8cf600020cd3e4b4a0791f16a63151fb97ffcb21e3e8d02cb03e13251342c1f3837e15c4e00202f877db14b6bb06b726da26c904b5499ea41b7ae4efd9fbd26fdfdaf5fe896280020b211bdabf8543535f0b1cfd7f34cc3f43a6b438d64619e1cd55753a5e4f4f82a0020e88c013d440557a456909c051118bbe7d247d65371a3be4f0eaf81ea02945816002086493829ce53dd735b2009bcb758accce5fcadbbe461f7ab4053354f7370ad280020c8a4f86e5af862153a396b52ca90431b935aeae6656e08b88090d598dfd1004400202f38bc5d2fa294edc0c472393b7802eec5dfd720697de89c4f04757cfbcb4c630020260b6dba4d2cec598fc1fb6522e5867f14974c7ce33f38260311ede65d3b493d0020c0f6238fd5f5e3330324426a4328d4468102faee2b9170b562cce7d3f3c30e3600207e78a57f3435a57077639e594f191416c77ed8adcbdd0211a2782906749b47590020286461a5c2dc87c1aecf382f889b8c6e4ccd8ff17330ea043d0df423be141a090020039b5febe4d7a7d8bd59c4ad7c2e882b661d1d0d04a7e3734cb59bb6719f7c4b0020f4667b4d55afb10445404bfec22bbefa767b6d4d3e7d6dddfbd3287d1d331d14002068c0f13b06a1cddac5673d25298fccf10af99520f344779961d847fb2003982900205531693ebac4028ca711a4141830e1585ef0ef907da34cf4ccc9e79880b98444002077fcc3e8456d7e0e87555ec99c581e8eba901c5b8021b202da49d85cf44690450020ed9c6e8ef5edc406eb41cf4ebcb4ca81ca18b1fdb202a19134e0fecd907cf84500201a58de42b76c01d399454a33029a4a00d67f25d1e061c128bad7b1aa8cc2e05e0020ac323db9096fdc647e6c2ab04fe500319621be4cc8c63373957946b92ed1874d00203d643214bb612e41b28a751764ef3edc447da92288d7d87b87a0d67936a23219002012ab3373d3740e14bb955faff5986e5a050941d49cbfedf90c381a8e4dc4b1030100000000000000a80e0e42628ae521b5971b6a6c0384e41a623e6332249f86ef080184440d5e0840d7c86706f5817aa718cd1cfad03233bcd64a7789fd9422d3b17af6823a7e6ac600e1f50500000000588cda2a47dd00dc14dd994a31963b9f1febd43835080852aa9f88d527f99f070000000000000000000000000000000000000000000000000000000000000000053f85f8103e8cb96c6c0c7dae45826d9bab350a6753be4534bc191b760f166d000000000000000000000000000000000110000000
Run "ironfish wallet:post" to post the raw transaction.

Documentation

Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference
)? If yes, link a
related documentation pull request for the website.

[ ] Yes

Breaking Change

Is this a breaking change? If yes, add notes below on why this is breaking and
what additional work is required, if any.

[ ] Yes

@ygao76 ygao76 requested a review from a team as a code owner March 10, 2023 01:20
Copy link
Contributor

@hughy hughy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! 👍

Reproduced the error and tested these changes and confirmed that they solve the issue!

@ygao76 ygao76 merged commit 2d80160 into staging Mar 10, 2023
@ygao76 ygao76 deleted the ygao-remove-is-confirmed-check branch March 10, 2023 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants