Code Monkey home page Code Monkey logo

Comments (3)

jseagrave21 avatar jseagrave21 commented on September 27, 2024

@hal0x2328 I am having trouble recreating your error. I changed the attribute unittests in test_send_commands.py to:

def test_attributes(self):
        nodemgr = NodeManager()
        nodemgr.reset_for_test()
        nodemgr.nodes = [NeoNode(object, object)]

        with patch('neo.Network.node.NeoNode.relay', return_value=self.async_return(True)):
            with patch('neo.Prompt.Commands.Send.prompt', side_effect=[UserWalletTestCase.wallet_1_pass()]):
                PromptData.Wallet = self.GetWallet1(recreate=True)
                args = ['send', 'gas', self.watch_addr_str, '2', '--tx-attr={"usage": 241,"data":"This is a remark"}']

                res = Wallet.CommandWallet().execute(args)
                for item in res.Attributes:
                    print(item.ToJson())
                self.assertTrue(res)
                self.assertEqual(2, len(
                    res.Attributes))  # By default the script_hash of the transaction sender is added to the TransactionAttribute list, therefore the Attributes length is `count` + 1

    def test_multiple_attributes(self):
        nodemgr = NodeManager()
        nodemgr.reset_for_test()
        nodemgr.nodes = [NeoNode(object, object)]

        with patch('neo.Network.node.NeoNode.relay', return_value=self.async_return(True)):
            with patch('neo.Prompt.Commands.Send.prompt', side_effect=[UserWalletTestCase.wallet_1_pass()]):
                PromptData.Wallet = self.GetWallet1(recreate=True)
                args = ['send', 'gas', self.watch_addr_str, '2',
                        '--tx-attr=[{"usage": 0x90,"data":"my brief description"}, {"usage":242,"data":"This is a remark 2"}]']

                res = Wallet.CommandWallet().execute(args)
                for item in res.Attributes:
                    print(item.ToJson())
                self.assertTrue(res)
                self.assertEqual(3, len(res.Attributes))

and got these results:

test_attributes (neo.Prompt.Commands.tests.test_send_commands.UserWalletTestCase) ... Sending with fee: 0
Validate your transaction details
---------------------------------
Sending 2 GAS from AJQ6FoaSXDFzA6wLnyZ1nFN7SGSN2oNTc3 to AGYaEi3W6ndHPUmW7T12FFfsbQ6DWymkEm
Returning 11.9998 GAS as change to AJQ6FoaSXDFzA6wLnyZ1nFN7SGSN2oNTc3

Enter your password to send to the network
Relayed Tx: 9b8af67d09ee01b2d877e9c63e91fed18b6903574444c953f97cc2184f68925f
{'usage': 32, 'data': '1cc9c05cefffe6cdd7b182816a9152ec218d2ec0'}
{'usage': 241, 'data': '5468697320697320612072656d61726b'}
ok

and

test_multiple_attributes (neo.Prompt.Commands.tests.test_send_commands.UserWalletTestCase) ... Sending with fee: 0
Validate your transaction details
---------------------------------
Sending 2 GAS from AJQ6FoaSXDFzA6wLnyZ1nFN7SGSN2oNTc3 to AGYaEi3W6ndHPUmW7T12FFfsbQ6DWymkEm
Returning 11.9998 GAS as change to AJQ6FoaSXDFzA6wLnyZ1nFN7SGSN2oNTc3

Enter your password to send to the network
Relayed Tx: 7ec898be6eb4ecd4b9969b3c69c804332fc7ed4195ab562089ce03aaa6f67d9a
{'usage': 32, 'data': '1cc9c05cefffe6cdd7b182816a9152ec218d2ec0'}
{'usage': 144, 'data': '6d79206272696566206465736372697074696f6e'}
{'usage': 242, 'data': '5468697320697320612072656d61726b2032'}
ok

I will let you know if I see something different from within prompt once I can get a privatenet spun up.

from neo-python.

jseagrave21 avatar jseagrave21 commented on September 27, 2024

@hal0x2328 I confirmed the behavior and am pushing a possible solution now

from neo-python.

jseagrave21 avatar jseagrave21 commented on September 27, 2024

@hal0x2328 could you confirm this issue is resolved?

from neo-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.