package commands const ( LOCKSTEP_PULL_REQUEST = 0x00 LOCKSTEP_SET_TRUSTLINE = 0x02 LOCKSTEP_INIT_PAYMENT = 0x04 LOCKSTEP_COMMIT_PAYMENT = 0x06 LOCKSTEP_SEAL_PAYMENT = 0x08 LOCKSTEP_FINALIZE_PAYMENT = 0x0A LOCKSTEP_CANCEL_PAYMENT = 0x0C LOCKSTEP_PAYMENT_FEE = 0x0E LOCKSTEP_SWARM_REDISTRIBUTION = 0x10 ) const ( ACCOUNT_FIND_PATH = 0x80 ACCOUNT_PATH_RECURSE = 0x81 ACCOUNT_PATH_FOUND = 0x82 ACCOUNT_PREPARE_PATH = 0x83 ) const ( USER_SET_TRUST_INDEX = 0x00 USER_ADD_ACCOUNT = 0x01 USER_SET_TRUSTLINE = 0x02 USER_NEW_PAYMENT = 0x03 USER_START_PAYMENT = 0x04 ) const ( COUNTERPART_FIND_PATH = 0x00 COUNTERPART_COMMIT_PAYMENT = 0x01 COUNTERPART_SEAL_PAYMENT = 0x02 ) func TxCommandName(cmd uint8) string { if cmd < 0x80 { cmd &= 0xFE } switch cmd { case LOCKSTEP_PULL_REQUEST: return "LOCKSTEP_PULL_REQUEST" case LOCKSTEP_SET_TRUSTLINE: return "LOCKSTEP_SET_TRUSTLINE" case LOCKSTEP_INIT_PAYMENT: return "LOCKSTEP_INIT_PAYMENT" case LOCKSTEP_COMMIT_PAYMENT: return "LOCKSTEP_COMMIT_PAYMENT" case LOCKSTEP_SEAL_PAYMENT: return "LOCKSTEP_SEAL_PAYMENT" case LOCKSTEP_FINALIZE_PAYMENT: return "LOCKSTEP_FINALIZE_PAYMENT" case LOCKSTEP_CANCEL_PAYMENT: return "LOCKSTEP_CANCEL_PAYMENT" case LOCKSTEP_PAYMENT_FEE: return "LOCKSTEP_PAYMENT_FEE" case LOCKSTEP_SWARM_REDISTRIBUTION: return "LOCKSTEP_SWARM_REDISTRIBUTION" case ACCOUNT_FIND_PATH: return "ACCOUNT_FIND_PATH" case ACCOUNT_PATH_RECURSE: return "ACCOUNT_PATH_RECURSE" case ACCOUNT_PATH_FOUND: return "ACCOUNT_PATH_FOUND" case ACCOUNT_PREPARE_PATH: return "ACCOUNT_PREPARE_PATH" default: return "invalid transaction command" } } func UserCommandName(cmd uint8) string { switch cmd { case USER_SET_TRUST_INDEX: return "USER_SET_TRUST_INDEX" case USER_ADD_ACCOUNT: return "USER_ADD_ACCOUNT" case USER_SET_TRUSTLINE: return "USER_SET_TRUSTLINE" case USER_NEW_PAYMENT: return "USER_NEW_PAYMENT" case USER_START_PAYMENT: return "USER_START_PAYMENT" default: return "invalid user command" } } func CptCommandName(cmd uint8) string { switch cmd { case COUNTERPART_FIND_PATH: return "COUNTERPART_FIND_PATH" case COUNTERPART_COMMIT_PAYMENT: return "COUNTERPART_COMMIT_PAYMENT" case COUNTERPART_SEAL_PAYMENT: return "COUNTERPART_SEAL_PAYMENT" default: return "invalid counterpart command" } }