Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Unify ApplicationEngine output #643

Merged
merged 4 commits into from
Aug 11, 2020
Merged

Conversation

shargon
Copy link
Member

@shargon shargon commented Aug 6, 2020

Close #632

@shargon shargon requested a review from cloud8little August 6, 2020 09:54
@cloud8little
Copy link
Contributor

Test passed:

  1. get candidates
neo> get candidates
Invoking script with: '10c00c0d67657443616e646964617465730c1425059ecb4878d3a875f91c51ceded330d4575fde41627d5b52'
VM State: HALT
Gas Consumed: 1.0100757

Candidates:
0209f19e3627bed7f29d7ebea83d67e14febdad6c674c83fb72c4ad4e82e942a6a      300
02925bf55fe5db3a9213bd8b7ea5a3314e972a03cf162961401e6ef03d3c964fef      201
02eb7b9eed4a093ad5dc284d89e6a451bade3f19a3f9b5035db064fbcd272f6518      119499
  1. get validators
neo> get validators
Invoking script with: '10c00c0d67657456616c696461746f72730c1425059ecb4878d3a875f91c51ceded330d4575fde41627d5b52'
VM State: HALT
Gas Consumed: 1.0100757

Validators:
026a59b03f981a5dfded185472f4f19409cd229b5cfd11721e70f2b1d16079376a
  1. get committee
neo> get committee
Invoking script with: '10c00c0c676574436f6d6d69747465650c1425059ecb4878d3a875f91c51ceded330d4575fde41627d5b52'
VM State: HALT
Gas Consumed: 1.0100757

Committee:
024fa7faf85240822cbf6b665f58fcdf6d03ed0e62d18bd2db22216682f2b53147
026a59b03f981a5dfded185472f4f19409cd229b5cfd11721e70f2b1d16079376a
0273a5ed740acaf17f11ba70d2a9b1c950e86dc320a6efd88d532d087f94fe275b
027a4c687d168044dfb37ad32a51830f0c86b068084914f2373702393b1923ae5e
  1. register candidate
neo> register candidate NccZ8ugnQQdLBchEo45yoJ8Z99K5nLpNak
Invoking script with: '0c2102f4548e741bb64a6c6d5ff8a7760bac34885aba6f47b02bd68c629ebe531abfe211c00c11726567697374657243616e6469646174650c1425059ecb4878d3a875f91c51ceded330d4575fde41627d5b52'
VM State: HALT
Gas Consumed: 0.0600775
Result Stack: [{"type":"Boolean","value":true}]
relay tx(no|yes): no
neo> register candidate NccZ8ugnQQdLBchEo45yoJ8Z99K5nLpNak
Invoking script with: '0c2102f4548e741bb64a6c6d5ff8a7760bac34885aba6f47b02bd68c629ebe531abfe211c00c11726567697374657243616e6469646174650c1425059ecb4878d3a875f91c51ceded330d4575fde41627d5b52'
VM State: HALT
Gas Consumed: 0.0600775
Result Stack: [{"type":"Boolean","value":true}]
relay tx(no|yes): yes
Signed and relayed transaction with hash=0x42abee0a084cdd1f2f8a477946d9aebc22cf53639ddcd9df7c3884feb8431e38
  1. vote
neo> vote NccZ8ugnQQdLBchEo45yoJ8Z99K5nLpNak 02166b93d66306d106a85caa02c4d36b72f85e7db69e324f4989ecea696d87f5e4
Invoking script with: '0c2102166b93d66306d106a85caa02c4d36b72f85e7db69e324f4989ecea696d87f5e40c14b72efde755895a02b8a3bb4322b219858e647a5312c00c04766f74650c1425059ecb4878d3a875f91c51ceded330d4575fde41627d5b52'
VM State: HALT
Gas Consumed: 5.0100793
Result Stack: [{"type":"Boolean","value":false}]
relay tx(no|yes): yes
Signed and relayed transaction with hash=0x9264e2dc685bf4764c9d10c4bb7905f2a14e6b9075667c6ec7112d4128e09593

  1. unregister
neo> unregister candidate NccZ8ugnQQdLBchEo45yoJ8Z99K5nLpNak
Invoking script with: '0c2102f4548e741bb64a6c6d5ff8a7760bac34885aba6f47b02bd68c629ebe531abfe211c00c13756e726567697374657243616e6469646174650c1425059ecb4878d3a875f91c51ceded330d4575fde41627d5b52'
VM State: HALT
Gas Consumed: 0.0600775
Result Stack: [{"type":"Boolean","value":true}]
relay tx(no|yes): no
  1. invoke
neo> invoke 0x2ba240ddea4c848f96749664241d2122a6cbfb27 teststringadd [{"type":"String","value":"iam"},{"type":"String","value":"astudent"}]
Invoking script with: '0c086173747564656e740c0369616d12c00c0d74657374737472696e676164640c1427fbcba622211d24649674968f844ceadd40a22b41627d5b52'
VM State: HALT
Gas Consumed: 0.011709
Result Stack: [{"type":"Integer","value":"3"}]
Relay tx(no|yes): yes
Signed and relayed transaction with hash=0xc796e4df4ad72da86cc59806c017bc559f1d0c77f5ae4d0b0dfd2ff6ecdf8a71

Copy link
Contributor

@cloud8little cloud8little left a comment

Choose a reason for hiding this comment

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

@shargon could you fix the "relay" to "Relay" please?

if (!ReadUserInput("relay tx(no|yes)").IsYes())

@shargon shargon requested a review from cloud8little August 10, 2020 08:22
cloud8little
cloud8little previously approved these changes Aug 10, 2020
@shargon shargon requested a review from erikzhang August 10, 2020 11:51
@cloud8little
Copy link
Contributor

Retest.

@cloud8little
Copy link
Contributor

Retest passed:

neo> register candidate NT6NSLhbztafwPrVsbFyt4E5gEDRCBootC
Invoking script with: '0c21022a1edbbc5e04fc4de2b68a356771f93ff81063735c33cfcc387bb1d1ad78d87011c00c11726567697374657243616e6469646174650c1425059ecb4878d3a875f91c51ceded330d4575fde41627d5b52'
VM State: HALT
Gas Consumed: 0.0600775
Result Stack: [{"type":"Boolean","value":true}]
Relay tx(no|yes): yes
Signed and relayed transaction with hash=0x405b68644e56919e56627b814620b0970048684672ab9645c299409e74e48f21
neo> list asset
NTdzVdQ8SmFobD1XWCA1fR9tQr7gFv1SXf
NEO: 99999800
GAS: 30000223.79121

NbDPiFHUw83E4GJVpByARcBg4Fai6z3FtN
NEO: 0
GAS: 100

NT6NSLhbztafwPrVsbFyt4E5gEDRCBootC
NEO: 0
GAS: 100

NiBFeSqAELYqq3ZqQuRdDGzrC5tYNGVBEu
NEO: 0
GAS: 0

NeumVvPha4iXiPbXQJc4oXfSqcTSXoWkqa
NEO: 0
GAS: 0

NccZ8ugnQQdLBchEo45yoJ8Z99K5nLpNak
NEO: 0
GAS: 0

----------------------------------------------------
Total:   NEO: 99999800    GAS: 30000423.79121

NEO hash: 0xde5f57d430d3dece511cf975a8d37848cb9e0525
GAS hash: 0x668e0c1f9d7b70a99dd9e06eadd4c784d641afbc
neo> send neo NT6NSLhbztafwPrVsbFyt4E5gEDRCBootC 2000
password: ********
TXID: 0x5946d5071ba615d2837e1e62f9f4f03ac8aaafd931038a168e1cfa0486810092
neo> list asset
NTdzVdQ8SmFobD1XWCA1fR9tQr7gFv1SXf
NEO: 99997800
GAS: 30001111.6868902

NbDPiFHUw83E4GJVpByARcBg4Fai6z3FtN
NEO: 0
GAS: 100

NT6NSLhbztafwPrVsbFyt4E5gEDRCBootC
NEO: 2000
GAS: 99.9274986

NiBFeSqAELYqq3ZqQuRdDGzrC5tYNGVBEu
NEO: 0
GAS: 0

NeumVvPha4iXiPbXQJc4oXfSqcTSXoWkqa
NEO: 0
GAS: 0

NccZ8ugnQQdLBchEo45yoJ8Z99K5nLpNak
NEO: 0
GAS: 0

----------------------------------------------------
Total:   NEO: 99999800    GAS: 30001311.6143888

NEO hash: 0xde5f57d430d3dece511cf975a8d37848cb9e0525
GAS hash: 0x668e0c1f9d7b70a99dd9e06eadd4c784d641afbc
neo> get candidates
Invoking script with: '10c00c0d67657443616e646964617465730c1425059ecb4878d3a875f91c51ceded330d4575fde41627d5b52'
VM State: HALT
Gas Consumed: 1.0100757

Candidates:
02166b93d66306d106a85caa02c4d36b72f85e7db69e324f4989ecea696d87f5e4      99997800
022a1edbbc5e04fc4de2b68a356771f93ff81063735c33cfcc387bb1d1ad78d870      0
neo> vote NT6NSLhbztafwPrVsbFyt4E5gEDRCBootC 022a1edbbc5e04fc4de2b68a356771f93ff81063735c33cfcc387bb1d1ad78d870
Invoking script with: '0c21022a1edbbc5e04fc4de2b68a356771f93ff81063735c33cfcc387bb1d1ad78d8700c144ec0730eb984196f80ef3d159e51a6d7c16d877312c00c04766f74650c1425059ecb4878d3a875f91c51ceded330d4575fde41627d5b52'
VM State: HALT
Gas Consumed: 5.0100793
Result Stack: [{"type":"Boolean","value":true}]
Relay tx(no|yes): yes
Signed and relayed transaction with hash=0xbedf00c5cbf85e0a120e70b9c050d149236c03470f32617fded827901ce661cb
neo> unregister candidate NT6NSLhbztafwPrVsbFyt4E5gEDRCBootC
Invoking script with: '0c21022a1edbbc5e04fc4de2b68a356771f93ff81063735c33cfcc387bb1d1ad78d87011c00c13756e726567697374657243616e6469646174650c1425059ecb4878d3a875f91c51ceded330d4575fde41627d5b52'
VM State: HALT
Gas Consumed: 0.0600775
Result Stack: [{"type":"Boolean","value":true}]
Relay tx(no|yes): yes
Signed and relayed transaction with hash=0xfe98fbe53aa1cd3fc993e80b61acb197bdbf06da0d10cab4860ecfeec985abf8
neo> invoke 0x2ba240ddea4c848f96749664241d2122a6cbfb27 teststringadd [{"type":"String","value":"iam"},{"type":"String","value":"astudent"}]
Invoking script with: '0c086173747564656e740c0369616d12c00c0d74657374737472696e676164640c1427fbcba622211d24649674968f844ceadd40a22b41627d5b52'
VM State: FAULT
Gas Consumed: 0.0100775
Result Stack: []
Error: Operation is not valid due to the current state of the object.
Error: Operation is not valid due to the current state of the object.
neo> invoke 0x5b90e40f8acda1228a5726996853218a5fa8eb15 name []
Invoking script with: '10c00c046e616d650c1415eba85f8a2153689926578a22a1cd8a0fe4905b41627d5b52'
VM State: HALT
Gas Consumed: 0.012509
Result Stack: [{"type":"ByteString","value":"TmV3IFRva2Vu"}]
Relay tx(no|yes): no
neo> invoke 0x5b90e40f8acda1228a5726996853218a5fa8eb15 name []
Invoking script with: '10c00c046e616d650c1415eba85f8a2153689926578a22a1cd8a0fe4905b41627d5b52'
VM State: HALT
Gas Consumed: 0.012509
Result Stack: [{"type":"ByteString","value":"TmV3IFRva2Vu"}]
Relay tx(no|yes): yes
Signed and relayed transaction with hash=0xdfeb82f7bcb5f363edbad70e8d5f9281fc26554e8f6ffd794b7483c44b5e82e5

@shargon shargon merged commit b8ca802 into neo-project:master Aug 11, 2020
@shargon shargon deleted the unfiy-output branch August 11, 2020 09:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Similar Piece of Code for Invoke and SendTransaction Function
3 participants