Basic QR tests (+ number encoding fix) (#168)

* Basic QR tests (+ number encoding fix)

* skipEncoding for Address display

* Fixup comments
This commit is contained in:
Jaco Greeff
2019-07-29 17:40:08 +02:00
committed by GitHub
parent 0ad431ba87
commit f7bd11a293
8 changed files with 148 additions and 69 deletions
+10 -12
View File
@@ -2,20 +2,18 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
const DEFAULT_SIZE = 300;
const DEFAULT_IMG_SIZE = 300;
const ADDRESS_PREFIX = 'substrate:';
function createSize (size: number = DEFAULT_SIZE): Record<string, string> {
const height = `${size}px`;
return {
height,
width: height
};
}
const FRAME_SIZE = 1716;
const SUBSTRATE_ID = new Uint8Array([0x53]);
const CRYPTO_SR25519 = new Uint8Array([0x01]);
const CMD_SIGN_TX = new Uint8Array([0x00]);
export {
ADDRESS_PREFIX,
DEFAULT_SIZE,
createSize
CMD_SIGN_TX,
CRYPTO_SR25519,
DEFAULT_IMG_SIZE,
FRAME_SIZE,
SUBSTRATE_ID
};