Skip to content

Commit 861a0c4

Browse files
committed
fix non archive
1 parent 2754bfc commit 861a0c4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api/coreservice_with_height.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func newCoreServiceWithHeight(cs *coreService, height uint64) *coreServiceReader
4040

4141
func (core *coreServiceReaderWithHeight) Account(addr address.Address) (*iotextypes.AccountMeta, *iotextypes.BlockIdentifier, error) {
4242
if !core.cs.archiveSupported {
43-
return nil, nil, ErrArchiveNotSupported
43+
return core.cs.Account(addr)
4444
}
4545
ctx, span := tracer.NewSpan(context.Background(), "coreServiceReaderWithHeight.Account")
4646
defer span.End()
@@ -79,7 +79,7 @@ func (core *coreServiceReaderWithHeight) stateAndNonce(addr address.Address) (*s
7979

8080
func (core *coreServiceReaderWithHeight) ReadContract(ctx context.Context, callerAddr address.Address, elp action.Envelope) (string, *iotextypes.Receipt, error) {
8181
if !core.cs.archiveSupported {
82-
return "", nil, ErrArchiveNotSupported
82+
return core.cs.ReadContract(ctx, callerAddr, elp)
8383
}
8484
log.Logger("api").Debug("receive read smart contract request")
8585
exec, ok := elp.Action().(*action.Execution)

0 commit comments

Comments
 (0)