mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-24 02:01:43 +00:00
Some renames and small fixes.
This commit is contained in:
@ -15,7 +15,7 @@ func GetAccount(address []byte) (*ResponseGetAccount, error) {
|
||||
return &ResponseGetAccount{cache.GetAccount(address)}, nil
|
||||
}
|
||||
|
||||
func GetStorage(address, storage []byte) (*ResponseGetStorage, error) {
|
||||
func GetStorage(address, key []byte) (*ResponseGetStorage, error) {
|
||||
state := consensusState.GetState()
|
||||
account := state.GetAccount(address)
|
||||
if account == nil {
|
||||
@ -24,11 +24,11 @@ func GetStorage(address, storage []byte) (*ResponseGetStorage, error) {
|
||||
storageRoot := account.StorageRoot
|
||||
storageTree := state.LoadStorage(storageRoot)
|
||||
|
||||
_, value := storageTree.Get(RightPadWord256(storage).Bytes())
|
||||
_, value := storageTree.Get(RightPadWord256(key).Bytes())
|
||||
if value == nil {
|
||||
return &ResponseGetStorage{storage, nil}, nil
|
||||
return &ResponseGetStorage{key, nil}, nil
|
||||
}
|
||||
return &ResponseGetStorage{storage, value.([]byte)}, nil
|
||||
return &ResponseGetStorage{key, value.([]byte)}, nil
|
||||
}
|
||||
|
||||
func ListAccounts() (*ResponseListAccounts, error) {
|
||||
@ -50,9 +50,9 @@ func DumpStorage(addr []byte) (*ResponseDumpStorage, error) {
|
||||
return nil, fmt.Errorf("Unknown address: %X", addr)
|
||||
}
|
||||
storageRoot := account.StorageRoot
|
||||
storage := state.LoadStorage(storageRoot)
|
||||
storageTree := state.LoadStorage(storageRoot)
|
||||
storageItems := []StorageItem{}
|
||||
storage.Iterate(func(key interface{}, value interface{}) bool {
|
||||
storageTree.Iterate(func(key interface{}, value interface{}) bool {
|
||||
storageItems = append(storageItems, StorageItem{
|
||||
key.([]byte), value.([]byte)})
|
||||
return false
|
||||
|
Reference in New Issue
Block a user