Skip to content

Commit

Permalink
Merge branch 'master' into illia-malachyn/767-block-payload-response-…
Browse files Browse the repository at this point in the history
…object
  • Loading branch information
illia-malachyn authored Nov 5, 2024
2 parents 8a3527c + 5b17d2d commit 5a42ecd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions access/grpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,11 @@ func (c *Client) GetAccountKeyAtBlockHeight(ctx context.Context, address flow.Ad
return c.grpc.GetAccountKeyAtBlockHeight(ctx, address, keyIndex, height)
}

func (c *Client) GetAccountKeysAtLatestBlock(ctx context.Context, address flow.Address) ([]flow.AccountKey, error) {
func (c *Client) GetAccountKeysAtLatestBlock(ctx context.Context, address flow.Address) ([]*flow.AccountKey, error) {
return c.grpc.GetAccountKeysAtLatestBlock(ctx, address)
}

func (c *Client) GetAccountKeysAtBlockHeight(ctx context.Context, address flow.Address, height uint64) ([]flow.AccountKey, error) {
func (c *Client) GetAccountKeysAtBlockHeight(ctx context.Context, address flow.Address, height uint64) ([]*flow.AccountKey, error) {
return c.grpc.GetAccountKeysAtBlockHeight(ctx, address, height)
}

Expand Down
6 changes: 3 additions & 3 deletions access/grpc/convert/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,16 @@ func MessageToAccountKey(m *entities.AccountKey) (*flow.AccountKey, error) {
}, nil
}

func MessageToAccountKeys(m []*entities.AccountKey) ([]flow.AccountKey, error) {
var accountKeys []flow.AccountKey
func MessageToAccountKeys(m []*entities.AccountKey) ([]*flow.AccountKey, error) {
var accountKeys []*flow.AccountKey

for _, entity := range m {
accountKey, err := MessageToAccountKey(entity)
if err != nil {
return nil, err
}

accountKeys = append(accountKeys, *accountKey)
accountKeys = append(accountKeys, accountKey)
}

return accountKeys, nil
Expand Down
4 changes: 2 additions & 2 deletions access/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ func (c *BaseClient) GetAccountKeyAtBlockHeight(
func (c *BaseClient) GetAccountKeysAtLatestBlock(
ctx context.Context,
address flow.Address,
) ([]flow.AccountKey, error) {
) ([]*flow.AccountKey, error) {
request := &access.GetAccountKeysAtLatestBlockRequest{
Address: address.Bytes(),
}
Expand All @@ -726,7 +726,7 @@ func (c *BaseClient) GetAccountKeysAtBlockHeight(
ctx context.Context,
address flow.Address,
height uint64,
) ([]flow.AccountKey, error) {
) ([]*flow.AccountKey, error) {
request := &access.GetAccountKeysAtBlockHeightRequest{
Address: address.Bytes(),
BlockHeight: height,
Expand Down
4 changes: 2 additions & 2 deletions access/grpc/grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ func TestClient_GetAccountKeysAtLatestBlock(t *testing.T) {

keys, err := c.GetAccountKeysAtLatestBlock(ctx, account.Address)
require.NoError(t, err)
assert.Equal(t, *account.Keys[index], keys[index])
assert.Equal(t, *account.Keys[index], *keys[index])
}))

t.Run("Not found error", clientTest(func(t *testing.T, ctx context.Context, rpc *mocks.MockRPCClient, c *BaseClient) {
Expand Down Expand Up @@ -1105,7 +1105,7 @@ func TestClient_GetAccountKeysAtBlockHeight(t *testing.T) {

keys, err := c.GetAccountKeysAtBlockHeight(ctx, account.Address, height)
require.NoError(t, err)
assert.Equal(t, *account.Keys[index], keys[index])
assert.Equal(t, *account.Keys[index], *keys[index])
}))

t.Run("Not found error", clientTest(func(t *testing.T, ctx context.Context, rpc *mocks.MockRPCClient, c *BaseClient) {
Expand Down

0 comments on commit 5a42ecd

Please sign in to comment.