Update GetContractStateAttribute to take a Contract instead of contract hash
This commit is contained in:
@@ -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,6 +5,11 @@ type WatchedContract struct {
|
||||
Transactions []Transaction
|
||||
}
|
||||
|
||||
type Contract struct {
|
||||
Attributes ContractAttributes
|
||||
Hash string
|
||||
}
|
||||
|
||||
type ContractAttribute struct {
|
||||
Name string
|
||||
Type string
|
||||
|
||||
Reference in New Issue
Block a user