File tree Expand file tree Collapse file tree 12 files changed +34
-19
lines changed Expand file tree Collapse file tree 12 files changed +34
-19
lines changed Original file line number Diff line number Diff line change 1
- import 'dart:math' ;
2
-
3
1
import 'package:polkadart_keyring/polkadart_keyring.dart' ;
4
2
import 'package:tfchain_client/generated/dev/types/frame_system/account_info.dart' ;
5
3
import 'package:tfchain_client/generated/dev/types/sp_runtime/multiaddress/multi_address.dart' ;
Original file line number Diff line number Diff line change 1
1
import 'package:tfchain_client/generated/dev/types/pallet_smart_contract/types/contract.dart' ;
2
2
import 'package:tfchain_client/generated/dev/types/pallet_smart_contract/types/contract_lock.dart' ;
3
3
import 'package:tfchain_client/generated/dev/types/pallet_smart_contract/types/service_contract.dart' ;
4
- import 'package:tfchain_client/generated/dev/types/tfchain_runtime/origin_caller.dart' ;
5
4
import 'package:tfchain_client/tfchain_client.dart' ;
6
5
7
6
const twoWeeks = 1209600000 ;
@@ -56,7 +55,7 @@ class QueryContracts {
56
55
}
57
56
58
57
//TODO: double check that GracePeriod typed like that.
59
- final blockNumber = contract! .state.toJson ()["GracePeriod" ];
58
+ final blockNumber = contract.state.toJson ()["GracePeriod" ];
60
59
try {
61
60
final currentBlockNumber = await client.api.query.system.number ();
62
61
Original file line number Diff line number Diff line change 1
- import 'dart:math' ;
2
-
3
1
import 'package:tfchain_client/tfchain_client.dart' ;
4
2
5
3
class QueryBridge {
Original file line number Diff line number Diff line change @@ -7,8 +7,10 @@ import 'package:tfchain_client/tfchain_client.dart';
7
7
void main () {
8
8
group ("Query Balances Test" , () {
9
9
late QueryClient queryClient;
10
+ final String url =
11
+ Platform .environment['URL' ] ?? 'wss://tfchain.dev.grid.tf/ws' ;
10
12
setUp (() async {
11
- queryClient = QueryClient ("wss://tfchain.dev.grid.tf/ws" );
13
+ queryClient = QueryClient (url );
12
14
await queryClient.connect ();
13
15
});
14
16
@@ -54,8 +56,7 @@ void main() {
54
56
test ('Test Transfer TFTs with invalid amount' , () async {
55
57
try {
56
58
await client.balances.transfer (
57
- address:
58
- "oven strong mention shoulder night ghost correct exercise surge lady jungle hundred" ,
59
+ address: "5EcSXeEH35LriE2aWxX6v4yZSMq47vdJ1GgHEXDdhJxg9XjG" ,
59
60
amount: BigInt .zero);
60
61
} catch (error) {
61
62
expect (error, isNotNull);
Original file line number Diff line number Diff line change @@ -16,8 +16,10 @@ import 'package:tfchain_client/tfchain_client.dart';
16
16
void main () {
17
17
group ('Query Client Tests' , () {
18
18
late QueryClient queryClient;
19
+ final String url =
20
+ Platform .environment['URL' ] ?? 'wss://tfchain.dev.grid.tf/ws' ;
19
21
setUp (() async {
20
- queryClient = QueryClient ("wss://tfchain.dev.grid.tf/ws" );
22
+ queryClient = QueryClient (url );
21
23
await queryClient.connect ();
22
24
});
23
25
Original file line number Diff line number Diff line change @@ -8,8 +8,10 @@ import 'package:tfchain_client/tfchain_client.dart';
8
8
void main () {
9
9
group ("Query Contracts Test" , () {
10
10
late QueryClient queryClient;
11
+ final String url =
12
+ Platform .environment['URL' ] ?? 'wss://tfchain.dev.grid.tf/ws' ;
11
13
setUp (() async {
12
- queryClient = QueryClient ("wss://tfchain.dev.grid.tf/ws" );
14
+ queryClient = QueryClient (url );
13
15
await queryClient.connect ();
14
16
});
15
17
Original file line number Diff line number Diff line change @@ -8,8 +8,10 @@ import 'package:tfchain_client/tfchain_client.dart';
8
8
void main () {
9
9
group ("Query Farms Test" , () {
10
10
late QueryClient queryClient;
11
+ final String url =
12
+ Platform .environment['URL' ] ?? 'wss://tfchain.dev.grid.tf/ws' ;
11
13
setUp (() async {
12
- queryClient = QueryClient ("wss://tfchain.dev.grid.tf/ws" );
14
+ queryClient = QueryClient (url );
13
15
await queryClient.connect ();
14
16
});
15
17
@@ -54,7 +56,8 @@ void main() {
54
56
55
57
test ('Test create farm' , () async {
56
58
final random = Random ();
57
- final farmName = 'farm_${random .nextInt (999 )}' ;
59
+ final timestamp = DateTime .now ().millisecondsSinceEpoch;
60
+ final farmName = 'farm_${random .nextInt (999 )}_${timestamp }' ;
58
61
final farmId = await client.farms.create (name: farmName, publicIps: []);
59
62
expect (farmId, isNotNull);
60
63
});
Original file line number Diff line number Diff line change @@ -7,8 +7,10 @@ import 'package:tfchain_client/tfchain_client.dart';
7
7
void main () {
8
8
group ("Test Query Nodes" , () {
9
9
late QueryClient queryClient;
10
+ final String url =
11
+ Platform .environment['URL' ] ?? 'wss://tfchain.dev.grid.tf/ws' ;
10
12
setUp (() async {
11
- queryClient = QueryClient ("wss://tfchain.dev.grid.tf/ws" );
13
+ queryClient = QueryClient (url );
12
14
await queryClient.connect ();
13
15
});
14
16
Original file line number Diff line number Diff line change
1
+ import 'dart:io' ;
2
+
1
3
import 'package:test/test.dart' ;
2
4
import 'package:tfchain_client/generated/dev/types/pallet_tfgrid/types/pricing_policy.dart' ;
3
5
import 'package:tfchain_client/tfchain_client.dart' ;
4
6
5
7
void main () {
6
8
group ("Query Pricing Policies" , () {
7
9
late QueryClient queryClient;
10
+ final String url =
11
+ Platform .environment['URL' ] ?? 'wss://tfchain.dev.grid.tf/ws' ;
8
12
setUp (() async {
9
- queryClient = QueryClient ("wss://tfchain.dev.grid.tf/ws" );
13
+ queryClient = QueryClient (url );
10
14
await queryClient.connect ();
11
15
});
12
16
Original file line number Diff line number Diff line change @@ -6,8 +6,10 @@ import 'package:tfchain_client/tfchain_client.dart';
6
6
void main () {
7
7
group ("Query Bridge Test" , () {
8
8
late QueryClient queryClient;
9
+ final String url =
10
+ Platform .environment['URL' ] ?? 'wss://tfchain.dev.grid.tf/ws' ;
9
11
setUp (() async {
10
- queryClient = QueryClient ("wss://tfchain.dev.grid.tf/ws" );
12
+ queryClient = QueryClient (url );
11
13
await queryClient.connect ();
12
14
});
13
15
Original file line number Diff line number Diff line change
1
+ import 'dart:io' ;
2
+
1
3
import 'package:test/test.dart' ;
2
4
import 'package:tfchain_client/tfchain_client.dart' ;
3
5
4
6
void main () {
5
7
group ("Query Price Test" , () {
6
8
late QueryClient queryClient;
9
+ final String url =
10
+ Platform .environment['URL' ] ?? 'wss://tfchain.dev.grid.tf/ws' ;
7
11
setUp (() async {
8
12
queryClient = QueryClient ("wss://tfchain.dev.grid.tf/ws" );
9
13
await queryClient.connect ();
Original file line number Diff line number Diff line change 1
1
import 'dart:io' ;
2
-
3
2
import 'package:test/test.dart' ;
4
- import 'package:tfchain_client/generated/dev/types/pallet_tfgrid/types/twin.dart' ;
5
3
import 'package:tfchain_client/tfchain_client.dart' ;
6
4
7
5
void main () {
8
6
group ("Query Twins Test" , () {
9
7
late QueryClient queryClient;
8
+ final String url =
9
+ Platform .environment['URL' ] ?? 'wss://tfchain.dev.grid.tf/ws' ;
10
10
setUp (() async {
11
- queryClient = QueryClient ("wss://tfchain.dev.grid.tf/ws" );
11
+ queryClient = QueryClient (url );
12
12
await queryClient.connect ();
13
13
});
14
14
You can’t perform that action at this time.
0 commit comments