You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var ab tlb.AccountBlock
if err = tlb.LoadFromCell(&ab, slc); err != nil {
return fmt.Errorf("faled to parse account block: %w", err)
}
addr := address.NewAddress(0, byte(0), ab.Addr)
log.Info("account block's ", zap.Any("address", addr))
//state_update:^(HASH_UPDATE Account)
update := ab.StateUpdate.BeginParse()
var stateUpdate tlb.HashUpdate
err = tlb.LoadFromCell(&stateUpdate, update)
if err != nil {
log.Error("failed to get stateUpdate of account", zap.Any("address", addr), zap.Error(err))
return err
}
failed to get stateUpdate of account {"address": "EQAzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM7SN", "error": "magic is not correct for tlb.HashUpdate, want #72"}
The text was updated successfully, but these errors were encountered:
Hi, it looks like a different data inside ab.StateUpdate, you can do println(ab.StateUpdate.Dump()) to check, maybe it is pruned (collapsed part of merkle proof)
9[500_] -> { 700[7333333333333333333333333333333333333333333333333333333333333333300002C285E7463C1848974E46DC8A97C4504891082FC0CA7C3BAACF53246573BA115992C293DEE8400002C285E65218266C31A96000140_] -> { 2[0_], 520[72EEA4BB9B1F6083C49D08F503E9DCBFF278E79253AF02972D54674716F85D8ADAD2CB747F6C5D680946ADE5E14E054E1140F676ACADF3051F98BE0AA11520861D], 21[203020] -> { 640[43281010B0760000000000000000009600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000], 365[C00000000000000000000000012D452DA449E50B8CF7DD27861F146122AFE1B546BB8B70FC8216F0C614139F8E00] } } }
Didn't see any Pruned Branch Cell.
Isn't your type definition consistent with TON's? https://github.com/ton-blockchain/ton/blob/24dc184a2ea67f9c47042b4104bbb4d82289fac1/crypto/block/block.tlb#L231-L233
How do I parse this StateUpdate ?
var ab tlb.AccountBlock
if err = tlb.LoadFromCell(&ab, slc); err != nil {
return fmt.Errorf("faled to parse account block: %w", err)
}
addr := address.NewAddress(0, byte(0), ab.Addr)
log.Info("account block's ", zap.Any("address", addr))
//state_update:^(HASH_UPDATE Account)
update := ab.StateUpdate.BeginParse()
var stateUpdate tlb.HashUpdate
err = tlb.LoadFromCell(&stateUpdate, update)
if err != nil {
log.Error("failed to get stateUpdate of account", zap.Any("address", addr), zap.Error(err))
return err
}
failed to get stateUpdate of account {"address": "EQAzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM7SN", "error": "magic is not correct for tlb.HashUpdate, want #72"}
The text was updated successfully, but these errors were encountered: