diff --git a/chain/event.go b/chain/event.go index 6f87da0..ba8ffce 100755 --- a/chain/event.go +++ b/chain/event.go @@ -10,6 +10,7 @@ package chain import ( "bytes" "fmt" + "math/big" "reflect" "strconv" "strings" @@ -949,8 +950,8 @@ func (c *chainClient) RetrieveEvent_FileBank_CalculateReport(blockhash types.Has return result, errors.Errorf("failed: no %s event found", event.FileBankCalculateReport) } -func (c *chainClient) RetrieveEvent_Sminer_UpdataIp(blockhash types.Hash) (event.Sminer_UpdatePeerId, error) { - var result event.Sminer_UpdatePeerId +func (c *chainClient) RetrieveEvent_Sminer_UpdataIp(blockhash types.Hash) (event.Event_UpdatePeerId, error) { + var result event.Event_UpdatePeerId events, err := c.eventRetriever.GetEvents(blockhash) if err != nil { return result, err @@ -996,8 +997,8 @@ func (c *chainClient) RetrieveEvent_Sminer_UpdataIp(blockhash types.Hash) (event return result, errors.Errorf("failed: no %s event found", event.SminerUpdatePeerId) } -func (c *chainClient) RetrieveEvent_Sminer_UpdataBeneficiary(blockhash types.Hash) (event.Event_UpdataBeneficiary, error) { - var result event.Event_UpdataBeneficiary +func (c *chainClient) RetrieveEvent_Sminer_UpdataBeneficiary(blockhash types.Hash) (event.Event_UpdateBeneficiary, error) { + var result event.Event_UpdateBeneficiary events, err := c.eventRetriever.GetEvents(blockhash) if err != nil { return result, err @@ -1860,6 +1861,9 @@ func (c *chainClient) RetrieveBlock(blocknumber uint64) ([]string, []event.Extri if err != nil { return systemEvents, extrinsicsInfo, transferInfo, "", "", "", "", 0, err } + if blocknumber == 0 { + return systemEvents, extrinsicsInfo, transferInfo, blockhash.Hex(), block.Block.Header.ParentHash.Hex(), block.Block.Header.ExtrinsicsRoot.Hex(), block.Block.Header.StateRoot.Hex(), 0, nil + } events, err := c.eventRetriever.GetEvents(blockhash) if err != nil { return systemEvents, extrinsicsInfo, transferInfo, "", "", "", "", 0, err @@ -1867,13 +1871,9 @@ func (c *chainClient) RetrieveBlock(blocknumber uint64) ([]string, []event.Extri var eventsBuf = make([]string, 0) var signer string var fee string - // var from string - // var to string - // var amount string var ok bool var name string - var preExtName string - var result bool + //var parsedBalancesTransfer = true for _, e := range events { if e.Phase.IsApplyExtrinsic { if name, ok = ExtrinsicsName[block.Block.Extrinsics[e.Phase.AsApplyExtrinsic].Method.CallIndex]; ok { @@ -1889,52 +1889,49 @@ func (c *chainClient) RetrieveBlock(blocknumber uint64) ([]string, []event.Extri Events: []string{e.Name}, Result: true, }) - preExtName = name continue } - if e.Name == event.BalancesWithdraw { + eventsBuf = append(eventsBuf, e.Name) + if e.Name == event.TransactionPaymentTransactionFeePaid || + e.Name == event.EvmAccountMappingTransactionFeePaid { + signer, fee, _ = parseSignerAndFeePaidFromEvent(e) + } else if e.Name == event.BalancesTransfer { + //parsedBalancesTransfer = false + from, to, amount, _ := ParseTransferInfoFromEvent(e) + transferInfo = append(transferInfo, event.TransferInfo{ + From: from, + To: to, + Amount: amount, + Result: true, + }) + // transfers, err := c.parseTransferInfoFromBlock(blockhash) + // if err != nil { + // return systemEvents, extrinsicsInfo, transferInfo, "", "", "", "", 0, err + // } + // if len(transfers) > 0 { + // transferInfo = append(transferInfo, transfers...) + // } + } else if e.Name == event.SystemExtrinsicSuccess { if len(eventsBuf) > 0 { - result = false - for i := 0; i < len(eventsBuf); i++ { - if eventsBuf[i] == event.SystemExtrinsicSuccess { - result = true - break - } - if eventsBuf[i] == event.SystemExtrinsicFailed { - result = false - break - } - } extrinsicsInfo = append(extrinsicsInfo, event.ExtrinsicsInfo{ - Name: preExtName, + Name: name, Signer: signer, FeePaid: fee, - Result: result, + Result: true, Events: append(make([]string, 0), eventsBuf...), }) - preExtName = name eventsBuf = make([]string, 0) } - } - eventsBuf = append(eventsBuf, e.Name) - if e.Name == event.TransactionPaymentTransactionFeePaid { - signer, fee, _ = parseSignerAndFeePaidFromEvent(e) - } - if e.Name == event.BalancesTransfer { - // fmt.Println("find transfer event") - // from, to, amount, _ = parseTransferInfoFromEvent(e) - // transferInfo = append(transferInfo, event.TransferInfo{ - // From: from, - // To: to, - // Amount: amount, - // Result: true, - // }) - transfers, err := c.parseTransferInfoFromBlock(blockhash) - if err != nil { - return systemEvents, extrinsicsInfo, transferInfo, "", "", "", "", 0, err - } - if len(transfers) > 0 { - transferInfo = append(transferInfo, transfers...) + } else if e.Name == event.SystemExtrinsicFailed { + if len(eventsBuf) > 0 { + extrinsicsInfo = append(extrinsicsInfo, event.ExtrinsicsInfo{ + Name: name, + Signer: signer, + FeePaid: fee, + Result: false, + Events: append(make([]string, 0), eventsBuf...), + }) + eventsBuf = make([]string, 0) } } } @@ -1942,26 +1939,6 @@ func (c *chainClient) RetrieveBlock(blocknumber uint64) ([]string, []event.Extri systemEvents = append(systemEvents, e.Name) } } - if len(eventsBuf) > 0 { - result = false - for i := 0; i < len(eventsBuf); i++ { - if eventsBuf[i] == event.SystemExtrinsicSuccess { - result = true - break - } - if eventsBuf[i] == event.SystemExtrinsicFailed { - result = false - break - } - } - extrinsicsInfo = append(extrinsicsInfo, event.ExtrinsicsInfo{ - Name: name, - Signer: signer, - FeePaid: fee, - Result: result, - Events: append(make([]string, 0), eventsBuf...), - }) - } return systemEvents, extrinsicsInfo, transferInfo, blockhash.Hex(), block.Block.Header.ParentHash.Hex(), block.Block.Header.ExtrinsicsRoot.Hex(), block.Block.Header.StateRoot.Hex(), timeUnixMilli, nil } @@ -1969,8 +1946,9 @@ func parseSignerAndFeePaidFromEvent(e *parser.Event) (string, string, error) { if e == nil { return "", "", errors.New("event is nil") } - if e.Name != event.TransactionPaymentTransactionFeePaid { - return "", "", fmt.Errorf("event is not %s", event.TransactionPaymentTransactionFeePaid) + if e.Name != event.TransactionPaymentTransactionFeePaid && + e.Name != event.EvmAccountMappingTransactionFeePaid { + return "", "", fmt.Errorf("event is not %s or %s", event.TransactionPaymentTransactionFeePaid, event.EvmAccountMappingTransactionFeePaid) } var signAcc string var fee string @@ -1980,8 +1958,8 @@ func parseSignerAndFeePaidFromEvent(e *parser.Event) (string, string, error) { signAcc = parseAccount(val) } if reflect.TypeOf(v.Value).Kind() == reflect.Struct { - if v.Name == "actual_fee" { - fee = Explicit(val, 0) + if strings.Contains(v.Name, "actual") { + fee = ExplicitBigInt(val, 0) } } } @@ -2012,27 +1990,33 @@ func parseAccount(v reflect.Value) string { return acc } -func Explicit(v reflect.Value, depth int) string { +func ExplicitBigInt(v reflect.Value, depth int) string { var fee string if v.CanInterface() { + value, ok := v.Interface().(big.Int) + if ok { + return value.String() + } t := v.Type() switch v.Kind() { case reflect.Ptr: - fee = Explicit(v.Elem(), depth) + fee = ExplicitBigInt(v.Elem(), depth) case reflect.Struct: //fmt.Printf(strings.Repeat("\t", depth)+"%v %v {\n", t.Name(), t.Kind()) for i := 0; i < v.NumField(); i++ { f := v.Field(i) if f.Kind() == reflect.Struct || f.Kind() == reflect.Ptr { //fmt.Printf(strings.Repeat("\t", depth+1)+"%s %s : \n", t.Field(i).Name, f.Type()) - fee = Explicit(f, depth+2) + fee = ExplicitBigInt(f, depth+2) } else { if f.CanInterface() { //fmt.Printf(strings.Repeat("\t", depth+1)+"%s %s : %v \n", t.Field(i).Name, f.Type(), f.Interface()) } else { if t.Field(i).Name == "abs" { val := fmt.Sprintf("%v", f) - return val[1 : len(val)-1] + val = strings.TrimPrefix(val, "[") + val = strings.TrimSuffix(val, "]") + return val } //fmt.Printf(strings.Repeat("\t", depth+1)+"%s %s : %v \n", t.Field(i).Name, f.Type(), f) } @@ -2076,7 +2060,7 @@ func (c *chainClient) parseTransferInfoFromBlock(blockhash types.Hash) ([]event. return transferEvents, nil } -func parseTransferInfoFromEvent(e *parser.Event) (string, string, string, error) { +func ParseTransferInfoFromEvent(e *parser.Event) (string, string, string, error) { if e == nil { return "", "", "", errors.New("event is nil") } @@ -2089,8 +2073,6 @@ func parseTransferInfoFromEvent(e *parser.Event) (string, string, string, error) for _, v := range e.Fields { k := reflect.TypeOf(v.Value).Kind() val := reflect.ValueOf(v.Value) - fmt.Println("k: ", k) - fmt.Println("v.Name: ", v.Name) if k == reflect.Slice { if strings.Contains(v.Name, "from") { from = parseAccount(val) @@ -2101,10 +2083,161 @@ func parseTransferInfoFromEvent(e *parser.Event) (string, string, string, error) } if k == reflect.Struct { if v.Name == "amount" { - amount = Explicit(val, 0) + amount = ExplicitBigInt(val, 0) } } } - fmt.Println("amount: ", amount) return from, to, amount, nil } + +func (c *chainClient) RetrieveBlockTest(blocknumber uint64) ([]string, []event.ExtrinsicsInfo, []event.TransferInfo, string, string, string, string, int64, error) { + var timeUnixMilli int64 + var systemEvents = make([]string, 0) + var extrinsicsInfo = make([]event.ExtrinsicsInfo, 0) + var transferInfo = make([]event.TransferInfo, 0) + blockhash, err := c.GetSubstrateAPI().RPC.Chain.GetBlockHash(blocknumber) + if err != nil { + return systemEvents, extrinsicsInfo, transferInfo, "", "", "", "", 0, err + } + block, err := c.GetSubstrateAPI().RPC.Chain.GetBlock(blockhash) + if err != nil { + return systemEvents, extrinsicsInfo, transferInfo, "", "", "", "", 0, err + } + if blocknumber == 0 { + return systemEvents, extrinsicsInfo, transferInfo, blockhash.Hex(), block.Block.Header.ParentHash.Hex(), block.Block.Header.ExtrinsicsRoot.Hex(), block.Block.Header.StateRoot.Hex(), 0, nil + } + events, err := c.eventRetriever.GetEvents(blockhash) + if err != nil { + return systemEvents, extrinsicsInfo, transferInfo, "", "", "", "", 0, err + } + var eventsBuf = make([]string, 0) + var signer string + var fee string + var ok bool + var name string + //var parsedBalancesTransfer = true + for _, e := range events { + if e.Phase.IsApplyExtrinsic { + if name, ok = ExtrinsicsName[block.Block.Extrinsics[e.Phase.AsApplyExtrinsic].Method.CallIndex]; ok { + if name == ExtName_Timestamp_set { + timeDecoder := scale.NewDecoder(bytes.NewReader(block.Block.Extrinsics[e.Phase.AsApplyExtrinsic].Method.Args)) + timestamp, err := timeDecoder.DecodeUintCompact() + if err != nil { + return systemEvents, extrinsicsInfo, transferInfo, "", "", "", "", 0, err + } + timeUnixMilli = timestamp.Int64() + extrinsicsInfo = append(extrinsicsInfo, event.ExtrinsicsInfo{ + Name: name, + Events: []string{e.Name}, + Result: true, + }) + continue + } + eventsBuf = append(eventsBuf, e.Name) + if e.Name == event.TransactionPaymentTransactionFeePaid { + fmt.Println("transactionPayment.TransactionFeePaid:") + signer, fee, _ = parseSignerAndFeePaidFromEvent(e) + } else if e.Name == event.BalancesTransfer { + fmt.Println(e.Name + "---:") + from, to, amount, _ := ParseTransferInfoFromEvent(e) + transferInfo = append(transferInfo, event.TransferInfo{ + From: from, + To: to, + Amount: amount, + Result: true, + }) + // transfers, err := c.parseTransferInfoFromBlock(blockhash) + // if err != nil { + // return systemEvents, extrinsicsInfo, transferInfo, "", "", "", "", 0, err + // } + // if len(transfers) > 0 { + // transferInfo = append(transferInfo, transfers...) + // } + } else if e.Name == "Balances.Deposit" { + fmt.Println(e.Name + ":") + from, to, amount, _ := ParseTransferInfoFromEvent(e) + transferInfo = append(transferInfo, event.TransferInfo{ + From: from, + To: to, + Amount: amount, + Result: true, + }) + } else if e.Name == "Balances.Withdraw" { + fmt.Println(e.Name + ":") + from, to, amount, _ := ParseTransferInfoFromEvent(e) + transferInfo = append(transferInfo, event.TransferInfo{ + From: from, + To: to, + Amount: amount, + Result: true, + }) + } else if e.Name == "Treasury.Deposit" { + fmt.Println(e.Name + ":") + from, to, amount, _ := ParseTransferInfoFromEvent(e) + transferInfo = append(transferInfo, event.TransferInfo{ + From: from, + To: to, + Amount: amount, + Result: true, + }) + } else if e.Name == "Sminer.FaucetTopUpMoney" { + fmt.Println(e.Name + ":") + from, to, amount, _ := ParseTransferInfoFromEvent(e) + transferInfo = append(transferInfo, event.TransferInfo{ + From: from, + To: to, + Amount: amount, + Result: true, + }) + } else if e.Name == event.SystemExtrinsicSuccess { + fmt.Println(e.Name + ":") + ParseTransferInfoFromEvent(e) + if len(eventsBuf) > 0 { + extrinsicsInfo = append(extrinsicsInfo, event.ExtrinsicsInfo{ + Name: name, + Signer: signer, + FeePaid: fee, + Result: true, + Events: append(make([]string, 0), eventsBuf...), + }) + eventsBuf = make([]string, 0) + } + } else if e.Name == event.SystemExtrinsicFailed { + if len(eventsBuf) > 0 { + extrinsicsInfo = append(extrinsicsInfo, event.ExtrinsicsInfo{ + Name: name, + Signer: signer, + FeePaid: fee, + Result: false, + Events: append(make([]string, 0), eventsBuf...), + }) + eventsBuf = make([]string, 0) + } + } + } + } else { + systemEvents = append(systemEvents, e.Name) + } + } + return systemEvents, extrinsicsInfo, transferInfo, blockhash.Hex(), block.Block.Header.ParentHash.Hex(), block.Block.Header.ExtrinsicsRoot.Hex(), block.Block.Header.StateRoot.Hex(), timeUnixMilli, nil +} + +func parsestruct(v reflect.Value) string { + if v.Len() > 0 { + fmt.Println("v.Len(): ", v.Len()) + allValue0 := fmt.Sprintf("%v", v.Index(0)) + fmt.Println("v.Index(0): ", allValue0) + fmt.Println("v.Index(0).Kind: ", v.Index(0).Kind()) + ExplicitBigInt(v.Index(0), 0) + allValue1 := fmt.Sprintf("%v", v.Index(1)) + fmt.Println("v.Index(1): ", allValue1) + fmt.Println("v.Index(1).Kind: ", v.Index(1).Kind()) + ExplicitBigInt(v.Index(1), 0) + allValue2 := fmt.Sprintf("%v", v.Index(2)) + fmt.Println("v.Index(2): ", allValue2) + fmt.Println("v.Index(2).Kind: ", v.Index(2).Kind()) + ExplicitBigInt(v.Index(2), 0) + } + + return "" +} diff --git a/core/event/events.go b/core/event/events.go index 264060e..b8120b6 100755 --- a/core/event/events.go +++ b/core/event/events.go @@ -124,14 +124,14 @@ type Event_Deposit struct { Topics []types.Hash } -type Event_UpdataBeneficiary struct { +type Event_UpdateBeneficiary struct { Phase types.Phase Acc types.AccountID New types.AccountID Topics []types.Hash } -type Sminer_UpdatePeerId struct { +type Event_UpdatePeerId struct { Phase types.Phase Acc types.AccountID Old pattern.PeerId @@ -200,10 +200,10 @@ type Event_DeleteBucket struct { } type Event_TransferReport struct { - Phase types.Phase - Acc types.AccountID - Failed_list []pattern.FileHash - Topics []types.Hash + Phase types.Phase + Acc types.AccountID + DealHash pattern.FileHash + Topics []types.Hash } type Event_ReplaceFiller struct { @@ -417,6 +417,49 @@ type Event_ElectionFinalized struct { Topics []types.Hash } +type Event_PhaseTransitioned struct { + Phase types.Phase + From Signed + To Unsigneds + Round types.U32 + Topics []types.Hash +} + +type Signed struct { + Index types.U8 + Value types.U32 +} + +type Unsigneds struct { + Index types.U8 + UnsignedValue []UnsignedValue +} + +type UnsignedValue struct { + Bool types.Bool + Bn types.U32 +} + +type Event_SolutionStored struct { + Phase types.Phase + Compute ElectionCompute + Origin types.Option[types.AccountID] + PrevEjected types.Bool + Topics []types.Hash +} + +type ElectionCompute struct { + Index types.U8 + Value types.U8 +} + +type Event_Locked struct { + Phase types.Phase + Who types.AccountID + Amount types.U128 + Topics []types.Hash +} + type Event_ServiceFeePaid struct { Phase types.Phase Who types.AccountID @@ -455,6 +498,18 @@ type Event_TransactionFeePaid struct { Topics []types.Hash } +type Event_ValidatorPrefsSet struct { + Phase types.Phase + Stash types.AccountID + Prefs ValidatorPrefs + Topics []types.Hash +} + +type ValidatorPrefs struct { + Commission types.U32 + Blocked types.Bool +} + // ******************************************************* type ElectionScore struct { /// The minimal winner, in terms of total backing stake. @@ -532,8 +587,8 @@ type EventRecords struct { Sminer_AlreadyFrozen []Event_AlreadyFrozen Sminer_IncreaseCollateral []Event_IncreaseCollateral Sminer_Deposit []Event_Deposit - Sminer_UpdataBeneficiary []Event_UpdataBeneficiary - Sminer_UpdatePeerId []Sminer_UpdatePeerId + Sminer_UpdateBeneficiary []Event_UpdateBeneficiary + Sminer_UpdatePeerId []Event_UpdatePeerId Sminer_Receive []Event_Receive Sminer_MinerExitPrep []Event_MinerExitPrep Sminer_Withdraw []Event_Withdraw @@ -556,11 +611,22 @@ type EventRecords struct { TeeWorker_MasterKeyRotationFailed []Event_MasterKeyRotationFailed TeeWorker_MinimumCesealVersionChangedTo []Event_MinimumCesealVersionChangedTo - // system + // system - Staking + Balances_Locked []Event_Locked + + // system - EvmAccountMapping + EvmAccountMapping_ServiceFeePaid []Event_ServiceFeePaid + EvmAccountMapping_CallDone []Event_CallDone + EvmAccountMapping_TransactionFeePaid []Event_TransactionFeePaid + + // system - Staking + Staking_ValidatorPrefsSet []Event_ValidatorPrefsSet + + // system - ElectionProviderMultiPhase ElectionProviderMultiPhase_ElectionFinalized []Event_ElectionFinalized - EvmAccountMapping_ServiceFeePaid []Event_ServiceFeePaid - EvmAccountMapping_CallDone []Event_CallDone - EvmAccountMapping_TransactionFeePaid []Event_TransactionFeePaid + ElectionProviderMultiPhase_PhaseTransitioned []Event_PhaseTransitioned + ElectionProviderMultiPhase_SolutionStored []Event_SolutionStored + // system-gsrpc types.EventRecords } diff --git a/core/event/eventsName.go b/core/event/eventsName.go index 4c3a5e4..8f41f7b 100755 --- a/core/event/eventsName.go +++ b/core/event/eventsName.go @@ -76,6 +76,8 @@ const ( // TransactionPaymentTransactionFeePaid = "TransactionPayment.TransactionFeePaid" // + EvmAccountMappingTransactionFeePaid = "EvmAccountMapping.TransactionFeePaid" + // BalancesWithdraw = "Balances.Withdraw" BalancesTransfer = "Balances.Transfer" // diff --git a/core/sdk/sdk.go b/core/sdk/sdk.go index 0f9caa3..fe762e5 100755 --- a/core/sdk/sdk.go +++ b/core/sdk/sdk.go @@ -393,9 +393,9 @@ type SDK interface { // RetrieveEvent_Sminer_RegisterPoisKey(blockhash types.Hash) (event.Event_RegisterPoisKey, error) // - RetrieveEvent_Sminer_UpdataIp(blockhash types.Hash) (event.Sminer_UpdatePeerId, error) + RetrieveEvent_Sminer_UpdataIp(blockhash types.Hash) (event.Event_UpdatePeerId, error) // - RetrieveEvent_Sminer_UpdataBeneficiary(blockhash types.Hash) (event.Event_UpdataBeneficiary, error) + RetrieveEvent_Sminer_UpdataBeneficiary(blockhash types.Hash) (event.Event_UpdateBeneficiary, error) // RetrieveEvent_Sminer_MinerExitPrep(blockhash types.Hash) (event.Event_MinerExitPrep, error) // @@ -429,5 +429,7 @@ type SDK interface { // RetrieveBlock(blocknumber uint64) ([]string, []event.ExtrinsicsInfo, []event.TransferInfo, string, string, string, string, int64, error) // + RetrieveBlockTest(blocknumber uint64) ([]string, []event.ExtrinsicsInfo, []event.TransferInfo, string, string, string, string, int64, error) + // InitExtrinsicsName() error } diff --git a/example/new/sdk.go b/example/new/sdk.go index 41090a5..d68167a 100755 --- a/example/new/sdk.go +++ b/example/new/sdk.go @@ -52,7 +52,7 @@ func main() { log.Fatalln(err) } fmt.Println(sdk.RetrieveAllEventFromBlock(blockhash)) - return + // header, err := sdk.GetSubstrateAPI().RPC.Chain.GetHeader(blockhash) // if err != nil { // log.Fatalln(err) diff --git a/example/parseEvent/parseevent.go b/example/parseEvent/parseevent.go index b1f03f7..c7aa0e1 100755 --- a/example/parseEvent/parseevent.go +++ b/example/parseEvent/parseevent.go @@ -30,6 +30,12 @@ type MyEvent struct { } func main() { + // fmt.Println(time.Now().UTC().Truncate(24 * time.Hour).Add(time.Second).UnixMilli()) + // fmt.Println(time.UnixMilli(1706699208000).UTC().Truncate(24 * time.Hour).Add(time.Hour * 24).UnixMilli()) + // fmt.Println(time.Now().UTC()) + // fmt.Println(time.Now().UTC().Hour()) + // fmt.Println(time.Now().UTC().Minute()) + // return sdk, err := cess.New( context.Background(), cess.ConnectRpcAddrs(RPC_ADDRS), @@ -39,6 +45,17 @@ func main() { if err != nil { panic(err) } + + // fmeta, err := sdk.QueryFileMetadataByBlock("bf7e61cf8abe365dc30e525be5058fd3f502245322300d76fe169c9292c6ba48", 2) + // if err != nil { + // log.Fatal(err) + // } + // for _, segment := range fmeta.SegmentList { + // for _, fragment := range segment.FragmentList { + // fmt.Println(utils.EncodePublicKeyAsCessAccount(fragment.Miner[:])) + // } + // } + // return sdk.InitExtrinsicsName() // RetrieveEvent_FileBank_CalculateReport @@ -70,12 +87,13 @@ func main() { // } //fmt.Println(sdk.RetrieveAllEventFromBlock(bhash)) - fmt.Println(" --------- ") + sysEvents, extrinsics, transferInfo, blockhash, preHash, extHash, stHash, t, err := sdk.RetrieveBlock(11921) if err != nil { panic(err) } - fmt.Println("system events: ", sysEvents) + fmt.Println(" --------- ") + fmt.Println("extrinsics:") for k, v := range extrinsics { fmt.Println(" ", k, ": ", v.Name) @@ -83,6 +101,7 @@ func main() { fmt.Println(" FeePaid: ", v.FeePaid) fmt.Println(" Events: ", v.Events) } + fmt.Println("system events: ", sysEvents) fmt.Println("transfer info: ", transferInfo) fmt.Println("blockhash: ", blockhash) fmt.Println("preHash: ", preHash)