Releases: LimeChain/matchstick
Prerelease with all the binaries
Merge pull request #200 from LimeChain/separate-m1-binary Separate m1 binary
v0.1.5
In this release:
- Users can now expect a test to fail, using the
shouldFail
flag on thetest()
functions:
test("Should throw an error", () => {
throw new Error();
}, true);
If the test is marked with shouldFail = true
but DOES NOT fail, that will show up as an error in the logs and the test block will fail. Also, if it's marked with shouldFail = false
(the default state), the test executor will crash.
- Logs are now as close as in
graph-ts
as possible. Here's a simple example with all non-critical log types:
import { test } from "matchstick-as/assembly/index";
import { log } from "matchstick-as/assembly/log";
export function runTests(): void {
test("Success", () => {
log.success("Success!". []);
});
test("Error", () => {
log.error("Error :( ", []);
});
test("Debug", () => {
log.debug("Debugging...", []);
});
test("Info", () => {
log.info("Info!", []);
});
test("Warning", () => {
log.warning("Warning!", []);
});
}
Users can also simulate a critical failure, like so:
test("Blow everything up", () => {
log.critical("Boom!");
});
- Helper functions for asserting variable equality:
assert.equals(ethereum.Value.fromString("hello"); ethereum.Value.fromString("hello"));
// String
assert.stringEquals(DEFAULT_LOG_TYPE, newGravatarEvent.logType!);
// Address
assert.addressEquals(Address.fromString(DEFAULT_ADDRESS), newGravatarEvent.address);
// BigInt
assert.bigIntEquals(BigInt.fromI32(DEFAULT_LOG_INDEX), newGravatarEvent.logIndex);
// Bytes & nested objects
assert.bytesEquals((Bytes.fromHexString(DEFAULT_BLOCK_HASH) as Bytes), newGravatarEvent.block.hash);
v0.1.5a
In this release:
- Users can now expect a test to fail, using the
shouldFail
flag on thetest()
functions:
test("Should throw an error", () => {
throw new Error();
}, true);
If the test is marked with shouldFail = true
but DOES NOT fail, that will show up as an error in the logs and the test block will fail. Also, if it's marked with shouldFail = false
(the default state), the test executor will crash.
- Logs are now as close as in
graph-ts
as possible. Here's a simple example with all non-critical log types:
import { test } from "matchstick-as/assembly/index";
import { log } from "matchstick-as/assembly/log";
export function runTests(): void {
test("Success", () => {
log.success("Success!". []);
});
test("Error", () => {
log.error("Error :( ", []);
});
test("Debug", () => {
log.debug("Debugging...", []);
});
test("Info", () => {
log.info("Info!", []);
});
test("Warning", () => {
log.warning("Warning!", []);
});
}
Users can also simulate a critical failure, like so:
test("Blow everything up", () => {
log.critical("Boom!");
});
- Helper functions for asserting variable equality:
assert.equals(ethereum.Value.fromString("hello"); ethereum.Value.fromString("hello"));
// String
assert.stringEquals(DEFAULT_LOG_TYPE, newGravatarEvent.logType!);
// Address
assert.addressEquals(Address.fromString(DEFAULT_ADDRESS), newGravatarEvent.address);
// BigInt
assert.bigIntEquals(BigInt.fromI32(DEFAULT_LOG_INDEX), newGravatarEvent.logIndex);
// Bytes & nested objects
assert.bytesEquals((Bytes.fromHexString(DEFAULT_BLOCK_HASH) as Bytes), newGravatarEvent.block.hash);
v0.1.3
-
Now using API version 0.0.5 which means AssemblyScript version is updated from 0.6.x to 0.19.x
-
API 0.0.4 subgraphs won't work with this release
-
It is mandatory to update your global graph-cli version to the latest one (0.22.0) as it's the only one containing the updated
graph test
command and the only version currently working with API version 0.0.5 -
Manual downloading of the Matchstick binary is no longer necessary - after updating it is recommended that you just use the
graph test
command which will download the latest Matchstick binary and run the tests of the datasource you have given as an argument - example usagegraph test Gravity
-
This update also means that graph-ts version is updated to 0.22.0 and because of their changes in the ethereum namespace (all classes had empty constructors now almost all of them are filled with all the fields) the
newMockEvent()
method is now returning a fully mocked class of typeethereum.Event
. You can check for example uses in the README or in our example subgraph -
Logging is now done by importing the function/functions corresponding to your desired logging level (e.g.
import { success, critical } from "matchstick-as/assembly/index";
) instead of the old way with just importinglog
and calling its functions
Testing API version 0.0.5
0.1.3-pre made changes to lock file and to avoid warnings
v0.1.2
- Added additional binaries to support older os versions.
- Fixed bug causing the program to panic when dynamically creating a datasource.
- Added method for logging the whole store.
Testing older binaries
0.1.1-test-bin added forgotten dollar sign
v0.1.1
Stable
Merge pull request #124 from LimeChain/mock-function-revert Mock function revert
Name change
Merge pull request #117 from LimeChain/rebrand Change name