Skip to content

Commit

Permalink
Fixes issue with extrinsics named "call" (#392)
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
leonardocustodio authored Jan 13, 2024
1 parent 900ecf8 commit 3330917
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/polkadart_cli/lib/src/generator/pallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ Class createPalletTxs(
..name = 'Txs'
..constructors.add(Constructor((b) => b..constant = true))
..methods.addAll(generator.txs.map((tx) => Method((builder) {
final txName = ReCase(tx.name).camelCase;
var txName = ReCase(tx.name).camelCase;
final Reference primitive = tx.codec.primitive(dirname);
final Reference runtimePrimitive =
generator.runtimeCall.primitive(dirname);
Expand All @@ -546,6 +546,11 @@ Class createPalletTxs(
..named = true
..name = field.sanitizedName)))
..body = Block((b) {
if (sanitize(txName) ==
sanitize(primitive.symbol.toString())) {
txName = '${txName}Variant';
}

Expression expression =
declareFinal('_call').assign(primitive);

Expand Down

0 comments on commit 3330917

Please sign in to comment.