Skip to content

Commit

Permalink
centchain: Disable lookup index check for successful proxy execution
Browse files Browse the repository at this point in the history
  • Loading branch information
cdamian committed Dec 11, 2023
1 parent a7665ed commit b6c8dc1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions centchain/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,9 +524,8 @@ func getErrorIDFromDispatchError(value any) (*registry.ErrorID, error) {
}

const (
ProxyExecutedEventName = "Proxy.ProxyExecuted"
ResultFieldName = "Result.result"
ProxyExecutedExpectedLookupIndex = 41
ProxyExecutedEventName = "Proxy.ProxyExecuted"
ResultFieldName = "Result.result"
)

func checkSuccessfulProxyExecution(meta *types.Metadata, events []*parser.Event, extrinsicIdx int) error {
Expand All @@ -544,7 +543,7 @@ func checkSuccessfulProxyExecution(meta *types.Metadata, events []*parser.Event,
return errors.New("result field has unexpected size")
}

if res[0].Value == nil && res[0].LookupIndex == ProxyExecutedExpectedLookupIndex {
if res[0].Value == nil {
// The DispatchResult is Ok(()).
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion centchain/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ func TestApi_checkExtrinsicEventSuccess_ExtrinsicSuccess_WithProxySuccess(t *tes
Value: registry.DecodedFields{
{
Value: nil,
LookupIndex: ProxyExecutedExpectedLookupIndex,
LookupIndex: 41,
},
},
LookupIndex: 0,
Expand Down

0 comments on commit b6c8dc1

Please sign in to comment.