"The Walling of Asgard" fits pretty well into the category of "Deal with the Devil" legends. What a "Deal with the Devil" legend, you ask? Well, in one of those stories, a hero makes a deal with someone he might otherwise consider his enemy in order to accomplish something. Sounds a lot like the gods hiring the giant stone-mason, doesn't it?
The most famous "Deal with the Devil" story is the (originally German) legend of Dr. Faustus, who sells his soul to the devil in exchange for magical powers. That's why this type of story is also sometimes called the "Faustian Bargain."
There are lots of different kinds of deals you can make with the devil/an enemy giant, though. Let's think about some:
"Devil's Bridge" legends closely resemble "The Walling of Asgard" because of their focus big construction projects (bridges, walls – what's the difference?). Bridges built in Europe between 1000 to 1600 that are famous for their beauty or technological mastery sometimes have a folk tale associated with them that claims the devil built the bridge. In one legend, the bridge-builder promises the devil the soul of the first being to cross the bridge in exchange for his help, then cheats the devil by luring a dog across the bridge first.
Interested in reading some "Devil's Bridge" legends? You're in luck. You can find a list of stories here.
"Master Builder" legends feature a similar deal, often in exchange for the construction of a church. You can read a few of these stories here.