Update GetContractStateAttribute to take a Contract instead of contract hash

This commit is contained in:
Eric Meyer
2017-11-30 16:36:36 -06:00
parent 5c18639ef4
commit e9bfae9412
6 changed files with 112 additions and 98 deletions
+1 -5
View File
@@ -1,14 +1,10 @@
package core
type Contract struct {
Attributes ContractAttributes
}
type Blockchain interface {
GetBlockByNumber(blockNumber int64) Block
SubscribeToBlocks(blocks chan Block)
StartListening()
StopListening()
GetContract(contractHash string) (Contract, error)
GetContractStateAttribute(contractHash string, attributeName string) (interface{}, error)
GetAttribute(contract Contract, attributeName string) (interface{}, error)
}
+5
View File
@@ -5,6 +5,11 @@ type WatchedContract struct {
Transactions []Transaction
}
type Contract struct {
Attributes ContractAttributes
Hash string
}
type ContractAttribute struct {
Name string
Type string