func (db *DB) SetupCustodyTables(balanceSchema string, depositSchema string, pendingDepositSchema string) (err error) {

	// Initialize Balance tables
	// 66 bytes because we use big bytes and they use small bytes for varbinary
	if err = db.InitializeTables(balanceSchema, "pubkey VARBINARY(66), balance BIGINT(64)"); err != nil {
		err = fmt.Errorf("Could not initialize balance tables: \n%s", err)
		return
	}

	// Initialize Deposit tables
	if err = db.InitializeTables(depositSchema, "pubkey VARBINARY(66), address VARCHAR(34), CONSTRAINT unique_pubkeys UNIQUE (pubkey, address)"); err != nil {
		err = fmt.Errorf("Could not initialize deposit tables: \n%s", err)
		return
	}

	// Initialize pending_deposits table
	if err = db.InitializeNewTables(pendingDepositSchema, "pubkey VARBINARY(66), expectedConfirmHeight INT(32) UNSIGNED, depositHeight INT(32) UNSIGNED, amount BIGINT(64), txid TEXT"); err != nil {
		err = fmt.Errorf("Could not initialize pending deposit tables: \n%s", err)
		return
	}

	return
}
// SetupCustodyTables sets up the tables needed to track what funds a user has
SetupCustodyTables sets up the tables needed to track what funds a user has
// SetupCustodyTables sets up the tables needed to track what funds a user has
func (db *DB) SetupCustodyTables(balanceSchema string, depositSchema string, pendingDepositSchema string) (err error) {
	if err = db.InitializeTables(balanceSchema, "pubkey VARBINARY(66), balance BIGINT(64)"); err != nil {
		err = fmt.Errorf("Could not initialize balance tables: \n%s", err)
		return
	}
	if err = db.InitializeTables(depositSchema, "pubkey VARBINARY(66), address VARCHAR(34), CONSTRAINT unique_pubkeys UNIQUE (pubkey, address)"); err != nil {
		err = fmt.Errorf("Could not initialize deposit tables: \n%s", err)
		return
	}
	if err = db.InitializeNewTables(pendingDepositSchema, "pubkey VARBINARY(66), expectedConfirmHeight INT(32) UNSIGNED, depositHeight INT(32) UNSIGNED, amount BIGINT(64), txid TEXT"); err != nil {
		err = fmt.Errorf("Could not initialize pending deposit tables: \n%s", err)
		return
	}
	return
}
func ( db * DB ) SetupCustodyTables ( balanceSchema string , depositSchema string , pendingDepositSchema string ) ( err error ) { if err = db . InitializeTables ( balanceSchema , " " ) ; err != nil { err = fmt . Errorf ( " \n " , err ) return } if err = db . InitializeTables ( depositSchema , " " ) ; err != nil { err = fmt . Errorf ( " \n " , err ) return } if err = db . InitializeNewTables ( pendingDepositSchema , " " ) ; err != nil { err = fmt . Errorf ( " \n " , err ) return } return }
SetupCustodyTables sets up the tables needed to track what funds a user has
SetupCustodyTables sets up the tables needed to track what funds a user has
// Initialize Balance tables // 66 bytes because we use big bytes and they use small bytes for varbinary // Initialize Deposit tables // Initialize pending_deposits table