Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ğ
Ğcli-v2s
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fabrice LEBON
Ğcli-v2s
Commits
124bd9c2
Commit
124bd9c2
authored
1 year ago
by
Hugo Trentesaux
Browse files
Options
Downloads
Patches
Plain Diff
Resolve "fix outdated transaction" (
clients/rust/gcli-v2s!23
)
* review poka +fmt * use custom nonce
parent
4166a7b4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/commands.rs
+1
-1
1 addition, 1 deletion
src/commands.rs
src/utils.rs
+23
-19
23 additions, 19 deletions
src/utils.rs
with
24 additions
and
20 deletions
src/commands.rs
+
1
−
1
View file @
124bd9c2
...
...
@@ -6,7 +6,6 @@ pub mod collective;
pub
mod
distance
;
pub
mod
expire
;
pub
mod
identity
;
pub
mod
vault
;
pub
mod
net_test
;
pub
mod
oneshot
;
pub
mod
publish
;
...
...
@@ -16,3 +15,4 @@ pub mod smith;
pub
mod
sudo
;
pub
mod
transfer
;
pub
mod
ud
;
pub
mod
vault
;
This diff is collapsed.
Click to expand it.
src/utils.rs
+
23
−
19
View file @
124bd9c2
...
...
@@ -48,28 +48,32 @@ pub async fn submit_call<Payload: TxPayload>(
data
:
&
Data
,
payload
:
&
Payload
,
)
->
Result
<
TxProgress
,
subxt
::
Error
>
{
// get account nonce manually to be based on last block and not last finalized
let
nonce
=
data
.legacy_rpc_methods
()
// see issue #32
.await
.system_account_next_index
(
&
data
.address
())
.await
?
;
// sign and submit
match
data
.keypair
()
{
// sr25519 key pair
KeyPair
::
Sr25519
(
keypair
)
=>
{
data
.client
()
.tx
()
.sign_and_submit_then_watch_default
(
payload
,
&
PairSigner
::
<
Runtime
,
sp_core
::
sr25519
::
Pair
>
::
new
(
keypair
),
)
.await
}
KeyPair
::
Sr25519
(
keypair
)
=>
data
.client
()
.tx
()
.create_signed_with_nonce
(
payload
,
&
PairSigner
::
<
Runtime
,
sp_core
::
sr25519
::
Pair
>
::
new
(
keypair
),
nonce
,
Default
::
default
(),
),
// nacl key pair
KeyPair
::
Nacl
(
keypair
)
=>
{
data
.client
()
.tx
()
.sign_and_submit_then_watch_default
(
payload
,
&
commands
::
cesium
::
CesiumSigner
::
new
(
keypair
),
)
.await
}
}
KeyPair
::
Nacl
(
keypair
)
=>
data
.client
()
.tx
()
.create_signed_with_nonce
(
payload
,
&
commands
::
cesium
::
CesiumSigner
::
new
(
keypair
),
nonce
,
Default
::
default
(),
),
}
?
.submit_and_watch
()
.await
}
/// look event
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment