Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Duniter v2S
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
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
nodes
rust
Duniter v2S
Merge requests
!11
Use cucumber for integration tests
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Use cucumber for integration tests
elois-cucumber-tests
into
master
Overview
0
Commits
1
Pipelines
0
Changes
11
Merged
Éloïs
requested to merge
elois-cucumber-tests
into
master
3 years ago
Overview
0
Commits
1
Pipelines
0
Changes
2
Expand
0
0
Merge request reports
Compare
version 1
version 3
ce0360f3
3 years ago
version 2
50c5b05f
3 years ago
version 1
56586fa7
3 years ago
master (base)
and
latest version
latest version
8ba7799e
1 commit,
3 years ago
version 3
ce0360f3
1 commit,
3 years ago
version 2
50c5b05f
1 commit,
3 years ago
version 1
56586fa7
1 commit,
3 years ago
Show latest version
2 files
+
10
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
integration-tests/
src/balance_transfer
.rs
→
integration-tests/
tests/common/balances
.rs
+
15
−
25
Options
@@ -14,39 +14,29 @@
// You should have received a copy of the GNU Affero General Public License
// along with Substrate-Libre-Currency. If not, see <https://www.gnu.org/licenses/>.
use
crate
::
common
::
*
;
use
super
::
*
;
use
sp_keyring
::
AccountKeyring
;
use
subxt
::
PairSigner
;
#[tokio::test]
async
fn
test_balance_transfer
()
->
Result
<
(),
Box
<
dyn
std
::
error
::
Error
>>
{
env_logger
::
init
();
// Spawn a node
let
(
api
,
client
,
_process
)
=
spawn_node
()
.await
;
let
alice
=
PairSigner
::
new
(
AccountKeyring
::
Alice
.pair
());
let
dave
=
AccountKeyring
::
Dave
.to_account_id
();
let
events
=
create_block_with_extrinsic
(
&
client
,
pub
async
fn
transfer
(
api
:
&
Api
,
client
:
&
Client
,
from
:
AccountKeyring
,
amount
:
u64
,
to
:
AccountKeyring
,
)
->
Result
<
()
>
{
let
from
=
PairSigner
::
new
(
from
.pair
());
let
to
=
to
.to_account_id
();
let
_
events
=
create_block_with_extrinsic
(
client
,
api
.tx
()
.balances
()
.transfer
(
dave
.clone
()
.into
(),
512
)
.create_signed
(
&
alice
,
())
.transfer
(
to
.clone
()
.into
(),
amount
)
.create_signed
(
&
from
,
())
.await
?
,
)
.await
?
;
println!
(
"Balance transfer extrinsic written in blockchain, events: {:?}"
,
events
);
// verify that Bob's free Balance increased
let
dave_post
=
api
.storage
()
.system
()
.account
(
dave
,
None
)
.await
?
;
println!
(
"Bob's Free Balance is now {}
\n
"
,
dave_post
.data.free
);
assert_eq!
(
dave_post
.data.free
,
512
);
Ok
(())
}
Loading