# Soumission d'extrinsic avec nonce manuel

**URL:** https://forum.duniter.org/t/soumission-dextrinsic-avec-nonce-manuel/11764
**Category:** Duniter-v2
**Created:** [29 November 2023 20:02 UTC](https://forum.duniter.org/t/soumission-dextrinsic-avec-nonce-manuel/11764 "2023-11-29T20:02:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![HugoTrentesaux](https://forum.duniter.org/user_avatar/forum.duniter.org/hugotrentesaux/32/6396_2.png) [@HugoTrentesaux](https://forum.duniter.org/u/HugoTrentesaux)
#### Post date: [29 November 2023 20:02 UTC](https://forum.duniter.org/t/soumission-dextrinsic-avec-nonce-manuel/11764/1 "2023-11-29T20:02:52Z")

</div>

Sur ma branche `hugo-dev`, j’ai implémenté de manière rudimentaire une commande pour proposer un call au comité technique : [https://git.duniter.org/clients/rust/gcli-v2s/-/blob/hugo-dev/src/commands/collective.rs?ref\_type=heads#L143-153](https://git.duniter.org/clients/rust/gcli-v2s/-/blob/hugo-dev/src/commands/collective.rs?ref_type=heads#L143-153)

Mais j’ai l’erreur “[transaction is outdated](https://forum.duniter.org/t/outdated-transactions/11671)”

```auto
Subxt(Rpc(ClientError(Call(ErrorObject { code: ServerError(1010), message: "Invalid Transaction", data: Some(RawValue("Transaction is outdated")) }))))

```

une erreur substrate liée à une transaction périmée, par exemple si le nonce est trop petit.

J’ai donc tenté une implémentation alternative (`technical_committee_propose_nonce`) qui permet de donner un nonce custom. Les transactions sont bien soumises au réseau (si j’envoie plusieurs fois une transaction je peux avoir :

```auto
# Transaction Already Imported
Subxt(Rpc(ClientError(Call(ErrorObject { code: ServerError(1013), message: "Transaction Already Imported", data: Some(RawValue("Any { .. }")) }))))
ou
# Transaction is temporarily banned
Subxt(Rpc(ClientError(Call(ErrorObject { code: ServerError(1012), message: "Transaction is temporarily banned", data: None }))))

```

), mais à la première soumission, la fonction ne retourne jamais et je ne comprends pas pourquoi.

* * *

Pour info, voulant mettre `5CfodrEFe64MJtWvfhTHYBuUySr4WXLv2B41mZFucTXSGMFA` comme clé sudo, j’ai fait :

```txt
> subkey inspect
URI: <mnemonic>
Secret phrase: <secret>
  Network ID: substrate
  Secret seed: <secret>
  Public key (hex): 0x1ac50afda84f433ad094930ff4f1057c03f33bb11ae6956c33bde02661348d1d
  Account ID: 0x1ac50afda84f433ad094930ff4f1057c03f33bb11ae6956c33bde02661348d1d
  Public key (SS58): 5CfodrEFe64MJtWvfhTHYBuUySr4WXLv2B41mZFucTXSGMFA
  SS58 Address: 5CfodrEFe64MJtWvfhTHYBuUySr4WXLv2B41mZFucTXSGMFA

julia> @pipe hex2bytes("1ac50afda84f433ad094930ff4f1057c03f33bb11ae6956c33bde02661348d1d") |> Int.(_) |> join(_, ", ")
"26, 197, 10, 253, 168, 79, 67, 58, 208, 148, 147, 15, 244, 241, 5, 124, 3, 243, 59, 177, 26, 230, 149, 108, 51, 189, 224, 38, 97, 52, 141, 29"

> subxt explore --file ./res/metadata.scale Sudo calls set_key '{ new: Id (((26, 197, 10, 253, 168, 79, 67, 58, 208, 148, 147, 15, 244, 241, 5, 124, 3, 243, 59, 177, 26, 230, 149, 108, 51, 189, 224, 38, 97, 52, 141, 29))) }'
Encoded call data:
    0x90041402001ac50afda84f433ad094930ff4f1057c03f33bb11ae6956c33bde02661348d1d

> cargo run -- -S cesium tech propose 1402001ac50afda84f433ad094930ff4f1057c03f33bb11ae6956c33bde02661348d1d 47

```

On remarque que j’ai dû retirer le préfixe `0x9004` pour que le call soit décodé correctement. Mais c’est cohérent avec ce que dit l’app polkadotjs :

 ![image](https://forum.duniter.org/uploads/default/original/2X/5/55d1fb07f65e605e5db488d16a3ebd2ba95bab50.png)
