Skip to content

Commit d60dfe3

Browse files
authored
Merge pull request #527 from Zondax/dev
New Release
2 parents 483ec5e + 85851f3 commit d60dfe3

76 files changed

Lines changed: 720 additions & 491 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

actors/actor_parser.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ import (
1919

2020
type ActorParserInterface interface {
2121
GetMetadata(ctx context.Context, actorName string, txType string, msg *parser.LotusMessage, mainMsgCid cid.Cid, msgRct *parser.LotusMessageReceipt,
22-
height int64, key filTypes.TipSetKey) (string, map[string]interface{}, *types.AddressInfo, error)
22+
height int64, key filTypes.TipSetKey, canonical bool) (string, map[string]interface{}, *types.AddressInfo, error)
2323
}
2424

2525
type Actor interface {
2626
Name() string
27-
Parse(ctx context.Context, network string, height int64, txType string, msg *parser.LotusMessage, msgRct *parser.LotusMessageReceipt, mainMsgCid cid.Cid, key filTypes.TipSetKey) (map[string]interface{}, *types.AddressInfo, error)
27+
Parse(ctx context.Context, network string, height int64, txType string, msg *parser.LotusMessage, msgRct *parser.LotusMessageReceipt, mainMsgCid cid.Cid, key filTypes.TipSetKey, canonical bool) (map[string]interface{}, *types.AddressInfo, error)
2828
StartNetworkHeight() int64
2929
TransactionTypes() map[string]any
3030
Methods(ctx context.Context, network string, height int64) (map[abi.MethodNum]nonLegacyBuiltin.MethodMeta, error)

actors/address.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
// if the address is a zero address account actor, it returns the robust address of the zero address account actor
1414
// if the address is already a robust address, it returns the address
1515
// if the address is f2 evm, we consolidate f2 -> f0 -> f4
16-
func ConsolidateToRobustAddress(addr address.Address, h *helper.Helper, logger *logger.Logger, bestEffort bool) (string, error) {
16+
func ConsolidateToRobustAddress(addr address.Address, h *helper.Helper, logger *logger.Logger, bestEffort bool, canonical bool) (string, error) {
1717
actorCache := h.GetActorsCache()
1818
if ok, _, _ := h.IsZeroAddressAccountActor(addr); ok {
1919
return helper.ZeroAddressAccountActorRobust, nil
@@ -22,18 +22,18 @@ func ConsolidateToRobustAddress(addr address.Address, h *helper.Helper, logger *
2222
if isRobust, _ := common.IsRobustAddress(addr); isRobust {
2323
// we need to handle cases where a f2 address for evm actors is used
2424
// f2 -> f0 -> f4, as we want to consolidate the address to f4 style
25-
shortAddressStr, err := actorCache.GetShortAddress(addr)
25+
shortAddressStr, err := actorCache.GetShortAddress(addr, canonical)
2626
if err == nil {
2727
shortAddress, _ := address.NewFromString(shortAddressStr)
28-
addrStr, err := actorCache.GetRobustAddress(shortAddress)
28+
addrStr, err := actorCache.GetRobustAddress(shortAddress, canonical)
2929
if err == nil {
3030
addr, _ = address.NewFromString(addrStr)
3131
}
3232
}
3333
return addr.String(), nil
3434
}
3535

36-
robustAddress, err := actorCache.GetRobustAddress(addr)
36+
robustAddress, err := actorCache.GetRobustAddress(addr, canonical)
3737
if err != nil && !bestEffort {
3838
logger.Warnf("Error converting address %s to robust format: %v", addr, err)
3939
return "", fmt.Errorf("error converting address to robust format: %v", err) // Fallback

0 commit comments

Comments
 (0)