Skip to content

Commit cf09266

Browse files
authored
🐛 Fix encoder with deps and format files (#77)
Resolves #76
1 parent 17a9369 commit cf09266

File tree

24 files changed

+110
-108
lines changed

24 files changed

+110
-108
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ that can be found in the LICENSE file. -->
44

55
# Changelog
66

7+
## 1.0.0-dev.23
8+
9+
- Fix encoder with deps and format files.
10+
711
## 1.0.0-dev.22
812

913
- Correct invalid plugin references by marking FFI plugins.

lib/agent/actor.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class ActorCallError extends AgentFetchError {
2222
'Call failed:',
2323
' Canister: ${canisterId.toText()}',
2424
' Method: $methodName ($type)',
25-
...(props.entries).map((n) => " '${n.key}': ${jsonEncode(props[n])}"),
25+
...props.entries.map((n) => " '${n.key}': ${jsonEncode(props[n])}"),
2626
].join('\n');
2727
throw e;
2828
}
@@ -101,7 +101,7 @@ class CallConfig {
101101
'agent': agent,
102102
'pollingStrategyFactory': pollingStrategyFactory,
103103
'canisterId': canisterId,
104-
'effectiveCanisterId': effectiveCanisterId
104+
'effectiveCanisterId': effectiveCanisterId,
105105
};
106106
}
107107
}
@@ -149,7 +149,7 @@ class ActorConfig extends CallConfig {
149149
return {
150150
...super.toJson(),
151151
'callTransform': callTransform,
152-
'queryTransform': queryTransform
152+
'queryTransform': queryTransform,
153153
};
154154
}
155155
}
@@ -251,7 +251,7 @@ class Actor {
251251
dynamic result;
252252
if (func != null) {
253253
result = await func.call([
254-
{'amount': [], 'settings': []}
254+
{'amount': [], 'settings': []},
255255
]);
256256
}
257257
final canisterId = Principal.from(result['canister_id']);

lib/agent/agent.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/// Sub folders
21
export './agent/index.dart';
32
export './canisters/index.dart';
43
export './crypto/index.dart';

lib/agent/agent/api.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ abstract class Agent {
170170
Future<Map> status();
171171

172172
/// Send a query call to a canister. See
173-
/// {@link https://sdk.dfinity.org/docs/interface-spec/#http-query | the interface spec}.
173+
/// [the interface spec](https://sdk.dfinity.org/docs/interface-spec/#http-query).
174174
/// @param canisterId The Principal of the Canister to send the query to. Sending a query to
175175
/// the management canister is not supported (as it has no meaning from an agent).
176176
/// @param options Options to use to create and send the query.

lib/agent/agent/http/types.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,12 @@ typedef HttpAgentRequestTransformFnCall = Future<HttpAgentRequest?> Function(
209209

210210
class HttpResponseBody extends ResponseBody {
211211
const HttpResponseBody({
212-
bool? ok,
213-
int? status,
214-
String? statusText,
212+
super.ok,
213+
super.status,
214+
super.statusText,
215215
this.body,
216216
this.arrayBuffer,
217-
}) : super(ok: ok, status: status, statusText: statusText);
217+
});
218218

219219
factory HttpResponseBody.fromJson(Map<String, dynamic> map) {
220220
return HttpResponseBody(
@@ -240,7 +240,7 @@ class HttpResponseBody extends ResponseBody {
240240
'status': status,
241241
'statusText': statusText,
242242
'body': body,
243-
'arrayBuffer': arrayBuffer
243+
'arrayBuffer': arrayBuffer,
244244
};
245245
}
246246
}
@@ -320,7 +320,7 @@ class QueryResponseWithStatus extends QueryResponse {
320320
'arg': reply?.arg,
321321
},
322322
'rejected_code': rejectCode,
323-
'rejected_message': rejectMessage
323+
'rejected_message': rejectMessage,
324324
};
325325
}
326326
}

lib/agent/auth.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class AnonymousIdentity implements Identity {
9898
Future<Map<String, dynamic>> transformRequest(HttpAgentRequest request) {
9999
return Future.value({
100100
...request.toJson(),
101-
'body': {'content': request.body.toJson()}
101+
'body': {'content': request.body.toJson()},
102102
});
103103
}
104104
}

lib/agent/canisters/management_idl.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ Service managementIDL() {
1212
[
1313
IDL.Record(
1414
{'amount': IDL.Opt(IDL.Nat), 'settings': IDL.Opt(canisterSettings)},
15-
)
15+
),
1616
],
1717
[
18-
IDL.Record({'canister_id': canisterId})
18+
IDL.Record({'canister_id': canisterId}),
1919
],
2020
[],
2121
),
2222
'create_canister': IDL.Func(
2323
[],
2424
[
25-
IDL.Record({'canister_id': canisterId})
25+
IDL.Record({'canister_id': canisterId}),
2626
],
2727
[],
2828
),
@@ -32,7 +32,7 @@ Service managementIDL() {
3232
'mode': IDL.Variant({
3333
'install': IDL.Null,
3434
'reinstall': IDL.Null,
35-
'upgrade': IDL.Null
35+
'upgrade': IDL.Null,
3636
}),
3737
'canister_id': canisterId,
3838
'wasm_module': wasmModule,
@@ -46,7 +46,7 @@ Service managementIDL() {
4646
[
4747
IDL.Record(
4848
{'canister_id': canisterId, 'new_controller': IDL.Principal},
49-
)
49+
),
5050
],
5151
[],
5252
[],

lib/agent/certificate.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class Cert {
6969
return {
7070
'tree': tree,
7171
'signature': signature,
72-
'delegation': delegation?.toJson() ?? {}
72+
'delegation': delegation?.toJson() ?? {},
7373
};
7474
}
7575
}

lib/agent/crypto/keystore/function.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ Future<EncryptMessageResponse> encryptMessage({
322322
return EncryptMessageResponse(
323323
content: '$encryptedMessage?iv=$ivBase64',
324324
tags: [
325-
['p', theirPublicKey.toRaw().toHex()]
325+
['p', theirPublicKey.toRaw().toHex()],
326326
],
327327
kind: 4,
328328
createdAt: (DateTime.now().millisecondsSinceEpoch / 1000).floor(),
@@ -441,7 +441,7 @@ class EncryptMessageResponse {
441441
'tags': tags,
442442
'kind': kind,
443443
'created_at': createdAt,
444-
'pubkey': pubKey
444+
'pubkey': pubKey,
445445
};
446446
}
447447

lib/agent/crypto/keystore/key_derivator.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class _PBDKDF2KeyDerivator extends KeyDerivator {
3535
'c': iterations,
3636
'dklen': dklen,
3737
'prf': 'hmac-sha256',
38-
'salt': salt.toHex()
38+
'salt': salt.toHex(),
3939
};
4040
}
4141

0 commit comments

Comments
 (0)