Skip to content

Commit ce5976d

Browse files
committed
callbackID -> scheduledTxID
1 parent 501c541 commit ce5976d

6 files changed

Lines changed: 34 additions & 34 deletions

File tree

access/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ type Client interface {
9090
GetTransactionResultsByBlockID(ctx context.Context, blockID flow.Identifier) ([]*flow.TransactionResult, error)
9191

9292
// GetScheduledTransaction returns a scheduled transaction by callback ID.
93-
GetScheduledTransaction(ctx context.Context, callbackID uint64) (*flow.Transaction, error)
93+
GetScheduledTransaction(ctx context.Context, scheduledTxID uint64) (*flow.Transaction, error)
9494

9595
// GetScheduledTransactionResult returns the result of a scheduled transaction by callback ID.
96-
GetScheduledTransactionResult(ctx context.Context, callbackID uint64) (*flow.TransactionResult, error)
96+
GetScheduledTransactionResult(ctx context.Context, scheduledTxID uint64) (*flow.TransactionResult, error)
9797

9898
// GetSystemTransaction returns the system transaction for the given block ID.
9999
GetSystemTransaction(ctx context.Context, blockID flow.Identifier) (*flow.Transaction, error)

access/grpc/client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,12 @@ func (c *Client) GetTransactionResultsByBlockID(ctx context.Context, blockID flo
216216
return c.grpc.GetTransactionResultsByBlockID(ctx, blockID)
217217
}
218218

219-
func (c *Client) GetScheduledTransaction(ctx context.Context, callbackID uint64) (*flow.Transaction, error) {
220-
return c.grpc.GetScheduledTransaction(ctx, callbackID)
219+
func (c *Client) GetScheduledTransaction(ctx context.Context, scheduledTxID uint64) (*flow.Transaction, error) {
220+
return c.grpc.GetScheduledTransaction(ctx, scheduledTxID)
221221
}
222222

223-
func (c *Client) GetScheduledTransactionResult(ctx context.Context, callbackID uint64) (*flow.TransactionResult, error) {
224-
return c.grpc.GetScheduledTransactionResult(ctx, callbackID)
223+
func (c *Client) GetScheduledTransactionResult(ctx context.Context, scheduledTxID uint64) (*flow.TransactionResult, error) {
224+
return c.grpc.GetScheduledTransactionResult(ctx, scheduledTxID)
225225
}
226226

227227
func (c *Client) SendAndSubscribeTransactionStatuses(

access/grpc/grpc.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -602,12 +602,12 @@ func (c *BaseClient) GetTransactionResultsByBlockID(
602602

603603
func (c *BaseClient) GetScheduledTransaction(
604604
ctx context.Context,
605-
callbackID uint64,
605+
scheduledTxID uint64,
606606
opts ...grpc.CallOption,
607607
) (*flow.Transaction, error) {
608608

609609
req := &access.GetScheduledTransactionRequest{
610-
Id: callbackID,
610+
Id: scheduledTxID,
611611
}
612612

613613
res, err := c.rpcClient.GetScheduledTransaction(ctx, req, opts...)
@@ -626,11 +626,11 @@ func (c *BaseClient) GetScheduledTransaction(
626626

627627
func (c *BaseClient) GetScheduledTransactionResult(
628628
ctx context.Context,
629-
callbackID uint64,
629+
scheduledTxID uint64,
630630
opts ...grpc.CallOption,
631631
) (*flow.TransactionResult, error) {
632632
req := &access.GetScheduledTransactionResultRequest{
633-
Id: callbackID,
633+
Id: scheduledTxID,
634634
}
635635

636636
res, err := c.rpcClient.GetScheduledTransactionResult(ctx, req, opts...)

access/grpc/grpc_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ func TestClient_GetScheduledTransaction(t *testing.T) {
908908
txs := test.TransactionGenerator()
909909

910910
t.Run("Success", clientTest(func(t *testing.T, ctx context.Context, rpc *mocks.MockRPCClient, c *BaseClient) {
911-
var callbackID uint64 = 42
911+
var scheduledTxID uint64 = 42
912912
expectedTx := txs.New()
913913

914914
txMsg, err := convert.TransactionToMessage(*expectedTx)
@@ -920,19 +920,19 @@ func TestClient_GetScheduledTransaction(t *testing.T) {
920920

921921
rpc.On("GetScheduledTransaction", ctx, mock.Anything).Return(response, nil)
922922

923-
tx, err := c.GetScheduledTransaction(ctx, callbackID)
923+
tx, err := c.GetScheduledTransaction(ctx, scheduledTxID)
924924
require.NoError(t, err)
925925

926926
assert.Equal(t, expectedTx, tx)
927927
}))
928928

929929
t.Run("Not found error", clientTest(func(t *testing.T, ctx context.Context, rpc *mocks.MockRPCClient, c *BaseClient) {
930-
var callbackID uint64 = 99
930+
var scheduledTxID uint64 = 99
931931

932932
rpc.On("GetScheduledTransaction", ctx, mock.Anything).
933933
Return(nil, errNotFound)
934934

935-
tx, err := c.GetScheduledTransaction(ctx, callbackID)
935+
tx, err := c.GetScheduledTransaction(ctx, scheduledTxID)
936936
assert.Error(t, err)
937937
assert.Equal(t, codes.NotFound, status.Code(err))
938938
assert.Nil(t, tx)
@@ -942,41 +942,41 @@ func TestClient_GetScheduledTransaction(t *testing.T) {
942942
func TestClient_GetScheduledTransactionResult(t *testing.T) {
943943
t.Run("Success", clientTest(func(t *testing.T, ctx context.Context, rpc *mocks.MockRPCClient, c *BaseClient) {
944944
results := test.TransactionResultGenerator(flow.EventEncodingVersionCCF)
945-
var callbackID uint64 = 42
945+
var scheduledTxID uint64 = 42
946946
expectedResult := results.New()
947947
response, err := convert.TransactionResultToMessage(expectedResult, flow.EventEncodingVersionCCF)
948948
require.NoError(t, err)
949949

950950
rpc.On("GetScheduledTransactionResult", ctx, mock.Anything).Return(response, nil)
951951

952-
result, err := c.GetScheduledTransactionResult(ctx, callbackID)
952+
result, err := c.GetScheduledTransactionResult(ctx, scheduledTxID)
953953
require.NoError(t, err)
954954

955955
assert.Equal(t, expectedResult, *result)
956956
}))
957957

958958
t.Run("Success with jsoncdc", clientTest(func(t *testing.T, ctx context.Context, rpc *mocks.MockRPCClient, c *BaseClient) {
959959
results := test.TransactionResultGenerator(flow.EventEncodingVersionJSONCDC)
960-
var callbackID uint64 = 42
960+
var scheduledTxID uint64 = 42
961961
expectedResult := results.New()
962962
response, err := convert.TransactionResultToMessage(expectedResult, flow.EventEncodingVersionJSONCDC)
963963
require.NoError(t, err)
964964

965965
rpc.On("GetScheduledTransactionResult", ctx, mock.Anything).Return(response, nil)
966966

967-
result, err := c.GetScheduledTransactionResult(ctx, callbackID)
967+
result, err := c.GetScheduledTransactionResult(ctx, scheduledTxID)
968968
require.NoError(t, err)
969969

970970
assert.Equal(t, expectedResult, *result)
971971
}))
972972

973973
t.Run("Not found error", clientTest(func(t *testing.T, ctx context.Context, rpc *mocks.MockRPCClient, c *BaseClient) {
974-
var callbackID uint64 = 99
974+
var scheduledTxID uint64 = 99
975975

976976
rpc.On("GetScheduledTransactionResult", ctx, mock.Anything).
977977
Return(nil, errNotFound)
978978

979-
result, err := c.GetScheduledTransactionResult(ctx, callbackID)
979+
result, err := c.GetScheduledTransactionResult(ctx, scheduledTxID)
980980
assert.Error(t, err)
981981
assert.Equal(t, codes.NotFound, status.Code(err))
982982
assert.Nil(t, result)

access/http/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,11 @@ func (c *Client) GetTransactionResultsByBlockID(ctx context.Context, blockID flo
188188
return nil, fmt.Errorf("not implemented")
189189
}
190190

191-
func (c *Client) GetScheduledTransaction(ctx context.Context, callbackID uint64) (*flow.Transaction, error) {
191+
func (c *Client) GetScheduledTransaction(ctx context.Context, scheduledTxID uint64) (*flow.Transaction, error) {
192192
return nil, fmt.Errorf("not implemented")
193193
}
194194

195-
func (c *Client) GetScheduledTransactionResult(ctx context.Context, callbackID uint64) (*flow.TransactionResult, error) {
195+
func (c *Client) GetScheduledTransactionResult(ctx context.Context, scheduledTxID uint64) (*flow.TransactionResult, error) {
196196
return nil, fmt.Errorf("not implemented")
197197
}
198198

access/mocks/Client.go

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)