substrate icon indicating copy to clipboard operation
substrate copied to clipboard

migrate new benchmarking syntax from `frame_support::benchmarking` to `frame_benchmarking::v2`

Open sam0x17 opened this issue 1 year ago • 4 comments

Description

This migrates all of the new proc-macro-based benchmarking code to live under frame_benchmarking::v2.

This also migrates the old tt-macro-based benchmarking syntax from frame_benchmarking to frame_benchmarking::v1, but keeps a public export of v1::* at the root of frame_benchmarking, allowing existing benchmarking code. Sometime in the distant future we would remove this export when the v1 syntax is officially deprecated.

Presently the new proc-macro-based benchmarking syntax (https://github.com/paritytech/substrate/pull/12924), for reasons, lives in frame_support::benchmarking.

Implications

With this PR you now must use

use frame_benchmarking::v2::*;

to import the new benchmarking syntax.

You may also now use

use frame_benchmarking::v1::*;

to import the old benchmarking syntax, in addition to the existing way.

Related Issues

  • #13132

sam0x17 avatar Jan 24 '23 19:01 sam0x17