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

Fix Attribute class naming so methods work in VM #33

Merged
merged 2 commits into from
Jan 27, 2018

Conversation

slipo
Copy link
Contributor

@slipo slipo commented Jan 26, 2018

What current issue(s) from Github does this address?
None AFAIK

What problem does this PR solve?
The TransactionAttribute class wasn't working. I was running code like this:

from boa.blockchain.vm.Neo. TransactionAttribute import GetData
...
attributes = tx.Attributes
attribute = attributes[0]
sending_script_hash = GetData(attribute)
# Error here!
print(sending_script_hash)

Error was:

[I 180126 00:11:53 InteropService:304] method Neo.TransactionAttribute.GetData not found in ->
[I 180126 00:11:53 InteropService:306] Neo.Asset.GetOwner -> <bound method StateReader.Asset_GetOwner of <neo.SmartContract.StateReader.StateReader object at 0x111c05ef0>>
[I 180126 00:11:53 InteropService:306] AntShares.Header.GetNextConsensus -> <bound method StateReader.Header_GetNextConsensus of <neo.SmartContract.StateReader.StateReader object at 0x111c05ef0>>

How did you solve this problem?
Renamed the class to match what the VM expects.

How did you make sure your solution works?
Now my code works and getData returns the data I expect.

Are there any special changes in the code that we should be aware of?
No

Is there anything else we should know?
No

@coveralls
Copy link

coveralls commented Jan 26, 2018

Coverage Status

Coverage remained the same at 80.09% when pulling 79879cc on slipo:development into 4ba216d on CityOfZion:development.

@localhuman
Copy link
Collaborator

Great bug find and fix. Thank you! 🥇

@localhuman localhuman merged commit 207d9c4 into CityOfZion:development Jan 27, 2018
@slipo slipo deleted the development branch January 29, 2018 23:01
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.

None yet

3 participants