// Suicide marks the given account as suicided.
// This clears the account balance.
//
// The account's state object is still available until the state is committed,
// getStateObject will return a non-nil account after Suicide.
507480
func (self *StateDB) Suicide(addr common.Address) bool {
	stateObject := self.getStateObject(addr)
	if stateObject == nil {
		return false
	}
	self.journal.append(suicideChange{
		account:     &addr,
		prev:        stateObject.suicided,
		prevbalance: new(big.Int).Set(stateObject.Balance()),
	})
	stateObject.markSuicided()
	stateObject.data.Balance = new(big.Int)

	return true
}
915854
func (s *stateObject) empty() bool {
	return s.data.Nonce == 0 && s.data.Balance.Sign() == 0 && bytes.Equal(s.data.CodeHash, emptyCodeHash)
}
391795
func (d *FakeStateDriver) ClearState(key string) error {
	if _, ok := d.TestState[key]; ok {
		delete(d.TestState, key)
	}
	return nil
}
970129
func (self *stateObject) GetState(db Database, key common.Hash) common.Hash {
	// If we have a dirty value for this state entry, return it
	value, dirty := self.dirtyStorage[key]
	if dirty {
		return value
	}
	// Otherwise return the entry's original value
	return self.GetCommittedState(db, key)
}
989396
func (self *stateObject) SetState(db Database, key, value common.Hash) {
	// If the new value is the same as old, don't set
	prev := self.GetState(db, key)
	if prev == value {
		return
	}
	// New value is different, update and journal the change
	self.db.journal.append(storageChange{
		account:  &self.address,
		key:      key,
		prevalue: prev,
	})
	self.setState(key, value)
}
336389
func (vdb *versionedDB) GetState(namespace string, key string) (*statedb.VersionedValue, error) {
	logger.Debugf("GetState(). ns=%s, key=%s", namespace, key)
	compositeKey := constructCompositeKey(namespace, key)
	dbVal, err := vdb.db.Get(compositeKey)
	if err != nil {
		return nil, err
	}
	if dbVal == nil {
		return nil, nil
	}
	return decodeValue(dbVal)
}
563353
func (w *WalletState) Balances(ctx context.Context, accountID stellar1.AccountID) ([]stellar1.Balance, error) {
	a, ok := w.accountState(accountID)
	if !ok {
		// Balances is used frequently to get balances for other users,
		// so if accountID isn't in WalletState, just use the remote
		// to get the balances.
		w.G().Log.CDebugf(ctx, "WalletState:Balances using remoter for %s", accountID)
		return w.Remoter.Balances(ctx, accountID)
	}

	w.G().Log.CDebugf(ctx, "WalletState:Balances using account state for %s", accountID)
	return a.Balances(ctx)
}
753652
func (s *state) GetState(namespace string, key string) ([]byte, error) {
	values, err := s.GetStateMultipleKeys(namespace, []string{key})
	if err != nil {
		return nil, err
	}
	if len(values) == 0 {
		return nil, nil
	}
	return values[0], nil
}
983459
func (parser *TransitionParser) GetStateName(id ParserStateID) string {
	if id < ParserStateID(len(parser.lookup)) {
		return parser.lookup[id]
	}
	return ""
}
1054089
func (r *ReleaseAsset) GetState() string {
	if r == nil || r.State == nil {
		return ""
	}
	return *r.State
}
233562
func (qe *UpdateBatchBackedQueryExecuter) GetState(ns, key string) (*statedb.VersionedValue, error) {
	return qe.UpdateBatch.Get(ns, key), nil
}
919844
func (stub *MockStub) GetState(key string) ([]byte, error) {
	value := stub.State[key]
	mockLogger.Debug("MockStub", stub.Name, "Getting", key, value)
	return value, nil
}
961108
func (vm *VM) GetState() (string, error) {

	if vm.ID == "" {
		return "", fmt.Errorf("Need an ID to get virtual machine state")
	}

	if err := vm.updateInfo(); err != nil {
		return "", err
	}

	return vm.state, nil
}
1009787
func GetState(conn client.Connection, req StateRequest) (*State, error) {
	logger := plog.WithFields(log.Fields{
		"hostid":     req.HostID,
		"serviceid":  req.ServiceID,
		"instanceid": req.InstanceID,
	})

	basepth := "/"
	if req.PoolID != "" {
		basepth = path.Join("/pools", req.PoolID)
	}

	// Get the current host state
	hspth := path.Join(basepth, "/hosts", req.HostID, "instances", req.StateID())
	hsdat := &HostState{}
	if err := conn.Get(hspth, hsdat); err != nil {

		logger.WithError(err).Debug("Could not look up host state")
		return nil, &StateError{
			Request:   req,
			Operation: "get",
			Message:   "could not look up host state",
		}
	}

	logger.Debug("Found the host state")

	// Get the current service state
	sspth := path.Join(basepth, "/services", req.ServiceID, req.StateID())
	ssdat := &ServiceState{}
	if err := conn.Get(sspth, ssdat); err != nil {

		logger.WithError(err).Debug("Could not look up service state")
		return nil, &StateError{
			Request:   req,
			Operation: "get",
			Message:   "could not look up service state",
		}
	}

	logger.Debug("Found the service state")

	// Get the current state (status)
	cspth := path.Join(sspth, "current")
	cstate := &CurrentStateContainer{}
	if err := conn.Get(cspth, cstate); err != nil {
		logger.WithError(err).Debug("Could not look up current state (status)")
		return nil, &StateError{
			Request:   req,
			Operation: "get",
			Message:   "could not look up current state (status)",
		}
	}

	return &State{
		HostState:             *hsdat,
		ServiceState:          *ssdat,
		CurrentStateContainer: *cstate,
		HostID:                req.HostID,
		ServiceID:             req.ServiceID,
		InstanceID:            req.InstanceID,
	}, nil
}
210623
func (api *Client) GetAccount() (*Account, error) {
	result, _, err := api.makeRequest(http.MethodGet, api.concatUserPath(accountPath), &Account{})
	if err != nil {
		return nil, err
	}
	return result.(*Account), nil
}
775386
func (vm *VM) GetState() (string, error) {
	server, err := getServer(vm)
	if err != nil {
		return "", err
	}

	if server == nil {
		// VM state "unknown"
		return "", lvm.ErrVMInfoFailed
	}

	if server.Status == StateActive {
		return lvm.VMRunning, nil
	} else if server.Status == StateShutOff {
		return lvm.VMHalted, nil
	} else if server.Status == StateError {
		return lvm.VMError, nil
	}
	return lvm.VMUnknown, nil
}
746866
func (p *PullRequestReview) GetState() string {
	if p == nil || p.State == nil {
		return ""
	}
	return *p.State
}