Implement migration script with ussd and notify

This commit is contained in:
Louis Holbrook
2021-04-09 13:00:15 +00:00
parent 5a4e0b8eba
commit 7b16a36a62
65 changed files with 3892 additions and 1532 deletions

View File

@@ -1,12 +1,12 @@
import { ArgPair, Syncable } from '../sync';
import { Addressable, addressToBytes, bytesToHex, toKey } from '../digest';
import { Addressable, mergeKey } from '../digest';
class Phone extends Syncable implements Addressable {
address: string
value: number
constructor(address:string, v:number) {
constructor(address:string, v:string) {
const o = {
msisdn: v,
}
@@ -17,8 +17,8 @@ class Phone extends Syncable implements Addressable {
});
}
public static async toKey(msisdn:number) {
return await toKey(msisdn.toString(), ':cic.msisdn');
public static async toKey(msisdn:string) {
return await mergeKey(Buffer.from(msisdn), Buffer.from(':cic.phone'));
}
public key(): string {

View File

@@ -61,6 +61,7 @@ function addressToBytes(s:string) {
export {
toKey,
toAddressKey,
mergeKey,
bytesToHex,
addressToBytes,
Addressable,