From e4f9fc01dfca59d79a3b4f069c0de98dc52b99ae Mon Sep 17 00:00:00 2001 From: Rodrigo Villar Date: Wed, 23 Oct 2024 15:03:05 -0400 Subject: [PATCH] use CreateActionID() --- api/jsonrpc/server.go | 2 +- chain/transaction.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/jsonrpc/server.go b/api/jsonrpc/server.go index 9eab6f56b3..a2bdca155a 100644 --- a/api/jsonrpc/server.go +++ b/api/jsonrpc/server.go @@ -204,7 +204,7 @@ func (j *JSONRPCServer) ExecuteActions( for actionIndex, action := range actions { // Get expected state keys - stateKeysWithPermissions := action.StateKeys(args.Actor, ids.Empty) + stateKeysWithPermissions := action.StateKeys(args.Actor, chain.CreateActionID(ids.Empty, uint8(actionIndex))) // flatten the map to a slice of keys storageKeysToRead := make([][]byte, 0, len(stateKeysWithPermissions)) diff --git a/chain/transaction.go b/chain/transaction.go index 59bdd72e1e..a0908d4bd6 100644 --- a/chain/transaction.go +++ b/chain/transaction.go @@ -517,14 +517,14 @@ func EstimateUnits(r Rules, actions Actions, authFactory AuthFactory) (fees.Dime // Calculate over action/auth bandwidth += consts.Uint8Len - for _, action := range actions { + for i, action := range actions { actionSize, err := GetSize(action) if err != nil { return fees.Dimensions{}, err } actor := authFactory.Address() - stateKeys := action.StateKeys(actor, ids.Empty) + stateKeys := action.StateKeys(actor, CreateActionID(ids.Empty, uint8(i))) actionStateKeysMaxChunks, ok := stateKeys.ChunkSizes() if !ok { return fees.Dimensions{}, ErrInvalidKeyValue