What does あった and かいは means in here


[![enter image description
here](https://i.stack.imgur.com/MSxon.jpg)](https://i.stack.imgur.com/MSxon.jpg)

From what I understand 手に入れた権威をひけらかしたいだけの暴れん坊将軍につき合った can roughly translated
into I accompanied a hooligan shogun that only knows to flaunt the power he
obtained. What I don't understand is how かいは (which means something like
faction based on yomiwa which is a japanese language app) and あった (which is
past tense of to be exist) fits in this sentence.




  * This かい is 甲斐 in kanji. It has several meanings, but here it refers to "value worth doing something" or "enough result/motivation (to justify some action)". 甲斐があった is a set phrase that roughly means "it was meaningful/worthy".
  * This は is contrastive, i.e., [implies "at least"](https://japanese.stackexchange.com/a/29444/5010). For example, after watching a movie, 見た甲斐 **が** あった sounds like the speaker is satisfied, but 見た甲斐 **は** あった sounds like "It was not meaningless".

> ～につき合ったかいはあった。  
>  At least, it was worth it to deal with ～.

