meta/bundle.go
func (b *Bundle) InitialState(key xdr.LedgerKey) (*xdr.LedgerEntry, error) {
	all := b.Changes(key)

	if len(all) == 0 {
		return nil, ErrMetaNotFound
	}

	first := all[0]

	if first.Type != xdr.LedgerEntryChangeTypeLedgerEntryState {
		return nil, nil
	}

	result := first.MustState()

	return &result, nil
}
func (b *Bundle) InitialState(key xdr.LedgerKey) (*xdr.LedgerEntry, error) {
	all := b.Changes(key)

	if len(all) == 0 {
		return nil, ErrMetaNotFound
	}

	first := all[0]

	if first.Type != xdr.LedgerEntryChangeTypeLedgerEntryState {
		return nil, nil
	}

	result := first.MustState()

	return &result, nil
}
// InitialState returns the initial state of the LedgerEntry identified by `key`
// just prior to the application of the transaction the produced `b`.  Returns
// nil if the ledger entry did not exist prior to the bundle.