Skip to content

Commit

Permalink
use CreateActionID()
Browse files Browse the repository at this point in the history
  • Loading branch information
RodrigoVillar committed Oct 23, 2024
1 parent 26e8eaa commit e4f9fc0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/jsonrpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions chain/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e4f9fc0

Please sign in to comment.