Skip to content

Authorship


Calls


set_uncles

Provide a set of uncles.

Attributes

Name Type
new_uncles Vec<T::Header>

Python

call = substrate.compose_call(
    'Authorship', 'set_uncles', {
    'new_uncles': [
        {
            'digest': {
                'logs': [
                    {
                        None: None,
                        'Consensus': (
                            '[u8; 4]',
                            'Bytes',
                        ),
                        'Other': 'Bytes',
                        'PreRuntime': (
                            '[u8; 4]',
                            'Bytes',
                        ),
                        'RuntimeEnvironmentUpdated': None,
                        'Seal': (
                            '[u8; 4]',
                            'Bytes',
                        ),
                    },
                ],
            },
            'extrinsics_root': '[u8; 32]',
            'number': 'u32',
            'parent_hash': '[u8; 32]',
            'state_root': '[u8; 32]',
        },
    ],
}
)

Storage functions


Author

Author of current block.

Python

result = substrate.query(
    'Authorship', 'Author', []
)

Return value

'AccountId'

DidSetUncles

Whether uncles were already set in this block.

Python

result = substrate.query(
    'Authorship', 'DidSetUncles', []
)

Return value

'bool'

Uncles

Uncles

Python

result = substrate.query(
    'Authorship', 'Uncles', []
)

Return value

[{'InclusionHeight': 'u32', 'Uncle': ('[u8; 32]', (None, 'AccountId'))}]

Constants


UncleGenerations

The number of blocks back we should accept uncles. This means that we will deal with uncle-parents that are UncleGenerations + 1 before now.

Value

5

Python

constant = substrate.get_constant('Authorship', 'UncleGenerations')

Errors


GenesisUncle

The uncle is genesis.


InvalidUncleParent

The uncle parent not in the chain.


OldUncle

The uncle isn&#x27;t recent enough to be included.


TooHighUncle

The uncle is too high in chain.


TooManyUncles

Too many uncles.


UncleAlreadyIncluded

The uncle is already included.


UnclesAlreadySet

Uncles already set in the block.