diff --git a/core/rawdb/accessors_chain_test.go b/core/rawdb/accessors_chain_test.go index 58c8786fb..2eeb043ee 100644 --- a/core/rawdb/accessors_chain_test.go +++ b/core/rawdb/accessors_chain_test.go @@ -787,12 +787,14 @@ func TestAddressOutpointsStorage(t *testing.T) { TxHash: common.Hash{1}, Index: uint16(1), Denomination: uint8(1), + Lock: big.NewInt(0), } outpoint2 := types.OutpointAndDenomination{ TxHash: common.Hash{2}, Index: uint16(1), Denomination: uint8(1), + Lock: big.NewInt(0), } outpointMap := map[string]*types.OutpointAndDenomination{ @@ -811,17 +813,11 @@ func TestAddressOutpointsStorage(t *testing.T) { WriteAddressOutpoints(db, addressOutpointMap) if entry := ReadOutpointsForAddress(db, address); len(entry) == 0 || *entry[outpoint.Key()] != outpoint { - if len(entry) > 0 { - t.Fatalf("expected: %v \n found: %v", entry[outpoint.Key()], outpoint) - } - t.Fatal("Stored outpoint not found") + require.Equal(t, outpoint, *entry[outpoint.Key()]) } if entry := ReadOutpointsForAddress(db, address2); len(entry) == 0 || *entry[outpoint2.Key()] != outpoint2 { - if len(entry) > 0 { - t.Fatalf("expected: %v \n found: %v", entry[outpoint2.Key()], outpoint2) - } - t.Fatal("Stored outpoint not found") + require.Equal(t, outpoint2, *entry[outpoint2.Key()]) } } diff --git a/internal/quaiapi/quai_api.go b/internal/quaiapi/quai_api.go index fc60cd313..b0e54e5c2 100644 --- a/internal/quaiapi/quai_api.go +++ b/internal/quaiapi/quai_api.go @@ -56,11 +56,17 @@ func NewPublicQuaiAPI(b Backend) *PublicQuaiAPI { // GasPrice returns a suggestion for a gas price for legacy transactions. func (s *PublicQuaiAPI) GasPrice(ctx context.Context) (*hexutil.Big, error) { + if s.b.NodeLocation().Context() != common.ZONE_CTX { + return (*hexutil.Big)(big.NewInt(0)), errors.New("gasPrice call can only be made in zone chain") + } return (*hexutil.Big)(s.b.GetMinGasPrice()), nil } // MinerTip returns the gas price of the pool func (s *PublicQuaiAPI) MinerTip(ctx context.Context) *hexutil.Big { + if s.b.NodeLocation().Context() != common.ZONE_CTX { + return (*hexutil.Big)(big.NewInt(0)) + } return (*hexutil.Big)(s.b.GetPoolGasPrice()) } diff --git a/quaiclient/ethclient/ethclient.go b/quaiclient/ethclient/ethclient.go index 94fb35aca..f59c7d165 100644 --- a/quaiclient/ethclient/ethclient.go +++ b/quaiclient/ethclient/ethclient.go @@ -338,8 +338,8 @@ func (ec *Client) ContractSizeAt(ctx context.Context, account common.MixedcaseAd return (*big.Int)(&result), err } -func (ec *Client) GetOutpointsByAddress(ctx context.Context, address common.MixedcaseAddress) (map[string]*types.OutpointAndDenomination, error) { - var outpoints map[string]*types.OutpointAndDenomination +func (ec *Client) GetOutpointsByAddress(ctx context.Context, address common.MixedcaseAddress) ([]*types.OutpointAndDenomination, error) { + var outpoints []*types.OutpointAndDenomination err := ec.c.CallContext(ctx, &outpoints, "quai_getOutpointsByAddress", address.Original()) return outpoints, err }