Comments (3)
@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.
@hal0x2328 I confirmed the behavior and am pushing a possible solution now
from neo-python.
@hal0x2328 could you confirm this issue is resolved?
from neo-python.
Related Issues (20)
- Circular map reference causes Python stack overflow
- Docker build exits with errors HOT 9
- Privatenet fails to initialize HOT 2
- neo-python can't sync with Neo 2.10.3 nodes HOT 1
- Deploy Neo Smart Contract at runtiime. HOT 5
- Wallet & np-api-server issues HOT 2
- BigInteger ToByteArray incompatible with neo-vm v3.0.0 HOT 1
- Unclaimed gas calculation incorrect HOT 6
- About NEP-5 Smart Contracts HOT 8
- docker 只有Ubuntu的吗,在centos上运行出错
- centos7下,运行np-prompt,卡顿后后,ctrl + z 退出后,再此运行np-prompt,报错 HOT 1
- 运行np-prompt后,prompt.log中报错, HOT 1
- 运行np-prompt后,没有出现NEO命令行
- Connect to node problem HOT 2
- TestNet bootstrap HOT 1
- prompt input parser parses nested lists incorrectly HOT 1
- Simple Policy Plugin HOT 6
- np-bootstrap -c configure my local sync node that haved sync and the block data is finish. HOT 1
- np-bootstrap hangs at confirm prompt HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neo-python.