Skip to content

If need add the from address into account -- ConverterFunctionUtil #5

Description

@xeyesu
Function<EthBlock.Block, List<Account>> toAccounts
    = blk -> {
        Set<Account> accountSet = new HashSet<>();
        accountSet.add(new Account.Builder().hash(blk.getMiner()).build());
        for (EthBlock.TransactionResult txResult : blk.getTransactions()) {

            EthBlock.TransactionObject tx = (EthBlock.TransactionObject) txResult;
            if (null != tx.getTo()) {
                accountSet.add(new Account.Builder().hash(tx.getTo()).build());
            }
            //xys
            //TODO: if need add the from address into account list???
        }
        return new ArrayList<>(accountSet);
    };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions