-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚀 Implement v3 call (
callSync
) (#85)
- Loading branch information
Showing
24 changed files
with
202 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,38 @@ | ||
import 'package:agent_dart_base/agent_dart_base.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
void main() { | ||
actorTest(); | ||
} | ||
|
||
void actorTest() { | ||
/// skip, see https://github.com/dfinity/agent-js/blob/main/packages/agent/src/actor.test.ts | ||
test('actor', () async { | ||
final agent = HttpAgent( | ||
defaultHost: 'icp-api.io', | ||
defaultPort: 443, | ||
options: const HttpAgentOptions(identity: AnonymousIdentity()), | ||
); | ||
final idl = IDL.Service({ | ||
'create_challenge': IDL.Func( | ||
[], | ||
[ | ||
IDL.Record({ | ||
'png_base64': IDL.Text, | ||
'challenge_key': IDL.Text, | ||
}), | ||
], | ||
[], | ||
), | ||
}); | ||
final actor = CanisterActor( | ||
ActorConfig( | ||
canisterId: Principal.fromText('rdmx6-jaaaa-aaaaa-aaadq-cai'), | ||
agent: agent, | ||
), | ||
idl, | ||
); | ||
final result = await actor.getFunc('create_challenge')!.call([]); | ||
expect(result, isA<Map>()); | ||
expect(result['challenge_key'], isA<String>()); | ||
}); | ||
} |
Oops, something went wrong.